Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 588a4000ee
Fetching contributors…

Cannot retrieve contributors at this time

114 lines (92 sloc) 3.693 kb
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=
-->
<window title="Mozilla Bug "
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/chrome-harness.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
<script type="application/javascript" src="apphelper.js"/>
<!--<script type="application/javascript" src="jschannel.js"/>-->
<script type="application/javascript" src="jshelper.js"/>
<script type="application/javascript" src="urlmatch.js"/>
<!-- test results are displayed in the html:body -->
<head></head>
<body xmlns="http://www.w3.org/1999/xhtml">
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id="
target="_blank">Mozilla Bug </a>
</body>
<script>
steps = [setUp, verify_no_apps, get_installed_returns_nothing, install_super_crazy, get_self_returns_nothing,
get_self_on_domain, get_installed_on_domain, install_on_domain, tearDown];
runAll(steps);
function setUp(next) {
info("calling uninstallAll");
uninstallAll(next);
}
function verify_no_apps(next) {
info("in " + arguments.callee.name);
mozAppscb(navigator.mozApps.mgmt.getAll(),
{ status: "== \"success\""},
next);
}
function get_installed_returns_nothing(next) {
info("in " + arguments.callee.name);
mozAppscb(navigator.mozApps.getInstalled(),
{ status: "== \"success\""},
next);
}
function install_super_crazy(next) {
info("in " + arguments.callee.name);
var appURL = SERVERS['super_crazy'];
install(appURL,function() { getInstalled(appURL, next)});
}
function get_self_returns_nothing(next) {
mozAppscb(navigator.mozApps.getSelf(),
{ status: "== \"success\""},
next);
}
function get_self_on_domain(next) {
info("in " + arguments.callee.name);
onIframeLoad("super_crazy",next);
document.getElementById("super_crazy").contentWindow.postMessage("getSelf", '*');
}
function get_installed_on_domain(next) {
info("in " + arguments.callee.name);
onIframeLoad("super_crazy",next);
document.getElementById("super_crazy").contentWindow.postMessage("getInstalled", '*');
}
function uninstall_on_domain(next) {
info("in " + arguments.callee.name);
onIframeLoad("super_crazy",next);
document.getElementById("super_crazy").contentWindow.postMessage("uninstall", '*');
}
function install_on_domain(next) {
info("in " + arguments.callee.name);
onIframeLoad("no_delegated_install",next);
document.getElementById("no_delegated_install").contentWindow.postMessage("install", '*');
}
function tearDown() {
info("in " + arguments.callee.name);
uninstallAll();
}
function createIframe(name) {
var appURL = SERVERS[name];
appURL = appURL.substring(0,appURL.indexOf(name + ".webapp"));
var iframe = document.createElement("iframe");
iframe.setAttribute('type', 'content');
iframe.setAttribute('src', appURL + "include.html");
iframe.setAttribute('style', "width: 350px; height: 350px; display: block;");
iframe.setAttribute('id', name);
iframe.height = window.innerHeight + 'px';
iframe.width = window.innerWidth + 'px';
info(appURL + "include.html");
document.documentElement.appendChild(iframe);
}
createIframe("super_crazy");
createIframe("no_delegated_install");
</script>
</window>
Jump to Line
Something went wrong with that request. Please try again.