可以讓你隨時都知道自己有沒有把任何東西搞爆了。
有興趣的可以看一下
缺它不可!靈活運用 Firefox OS Gaia 的單元測試
語言本身無所不能,設計師的表達能力是唯一的極限
$ sudo npm -g install jscallgraph $ sudo apt-get install graphviz
$ jcg window_manager.js WindowManager > window_manager.dot
$ dot -Tpng -o window_manager.png window_manager.dot
new MozActivity({
name: 'save-bookmark',
data: {
type: 'url',
url: this.currentTab.url,
name: this.currentTab.title,
icon: place.iconUri
}
});
nsresult rv;
mProxy = do_CreateInstance("@mozilla.org/dom/activities/proxy;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);
mProxy->StartActivity(this, options, window);
return NS_OK;
cpmm.sendAsyncMessage("Activity:Start", { id: this.id, options: aOptions });
cpmm.addMessageListener("Activity:FireSuccess", this);
cpmm.addMessageListener("Activity:FireError", this);
let sysmm = Cc["@mozilla.org/system-message-internal;1"]
.getService(Ci.nsISystemMessagesInternal);
if (!sysmm) {
// System message is not present, what should we do?
return;
}
debug("Sending system message...");
let result = aResults.options[aChoice];
sysmm.sendMessage("activity", {
"id": aMsg.id,
"payload": aMsg.options,
"target": result.description
},
Services.io.newURI(result.description.href, null, null),
Services.io.newURI(result.manifest, null, null));
let page = { uri: aPage.uri,
manifest: aPage.manifest,
type: aPage.type,
target: aMessage.target };
debug("Asking to open " + JSON.stringify(page));
Services.obs.notifyObservers(this, "system-messages-open-app", JSON.stringify(page));
