gecko/webapprt/content/mochitest.xul
Myk Melez 782fce224f 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

45 lines
1.5 KiB
XML

<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window windowtype="webapprt:mochitest"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://webapprt/content/mochitest.js"/>
<script type="application/javascript">
Cu.import("resource://webapprt/modules/WebappRT.jsm");
// In test mode, the runtime isn't configured until we tell it to become
// an app, which requires us to use DOMApplicationRegistry to install one.
// But DOMApplicationRegistry needs to know the location of its registry dir,
// so we need to configure the runtime with at least that information.
WebappRT.config = {
registryDir: Services.dirsvc.get("ProfD", Ci.nsIFile).path,
};
Cu.import("resource://gre/modules/Webapps.jsm");
DOMApplicationRegistry.allAppsLaunchable = true;
becomeWebapp("http://mochi.test:8888/tests/webapprt/test/content/test.webapp",
undefined, function onBecome() {
Services.ww.openWindow(
null,
"chrome://webapprt/content/webapp.xul",
"_blank",
"chrome,dialog=no,resizable,scrollbars,centerscreen",
window.arguments[0]
);
window.close();
});
</script>
<description value="WebappRT Test Shim"/>
</window>