gecko/webapprt/test/chrome/browser_sample.js
Myk Melez 37ce4e65cd bug 770770: refactor webapp runtime test harness to reduce complexity/special-casing; r=adw
--HG--
extra : rebase_source : 183331b565d8c0577c9ba60a89f3c1ea6b11af9a
2012-08-14 15:27:26 -07:00

21 lines
757 B
JavaScript

// This is a sample WebappRT chrome test. It's just a browser-chrome mochitest.
Cu.import("resource://webapprt/modules/WebappRT.jsm");
function test() {
waitForExplicitFinish();
ok(true, "true is true!");
loadWebapp("sample.webapp", undefined, function onLoad() {
is(document.documentElement.getAttribute("title"),
WebappRT.config.app.manifest.name,
"Window title should be webapp name");
let msg = gAppBrowser.contentDocument.getElementById("msg");
var observer = new MutationObserver(function (mutations) {
ok(/^Webapp getSelf OK:/.test(msg.textContent),
"The webapp should have successfully installed and updated its msg");
finish();
});
observer.observe(msg, { childList: true });
});
}