Created
April 29, 2013 22:17
-
-
Save reuben/5485258 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| receiveMessage: function(aMessage) { | |
| let msg = aMessage.json; | |
| switch (aMessage.name) { | |
| case "Contact:Changed": | |
| // Fire oncontactchange event | |
| if (DEBUG) debug("Contacts:ContactChanged: " + msg.contactID + ", " + msg.reason); | |
| let event = new this._window.MozContactChangeEvent("contactchange", { | |
| contactID: msg.contactID, | |
| reason: msg.reason | |
| }); | |
| this.__DOM_IMPL__.dispatchEvent(event); | |
| break; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function () { | |
| ok(true, "Adding a new contact1"); | |
| createResult1 = new mozContact(); | |
| createResult1.initialize(properties1); | |
| mozContacts.addEventListener("contactchange", function(event) { | |
| is(event.contactID, createResult1.id, "Same contactID"); | |
| is(event.reason, "create", "Same reason"); | |
| next(); | |
| }); | |
| req = navigator.mozContacts.save(createResult1); | |
| req.onsuccess = function () { | |
| ok(createResult1.id, "The contact now has an ID."); | |
| sample_id1 = createResult1.id; | |
| checkContacts(properties1, createResult1); | |
| // next(); | |
| }; | |
| req.onerror = onFailure; | |
| }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment