2012-07-05 11:12:55 -07:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
<!-- Any copyright is dedicated to the Public Domain.
|
|
|
|
- http://creativecommons.org/publicdomain/zero/1.0/ -->
|
|
|
|
|
|
|
|
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
|
|
|
|
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
|
|
|
|
|
|
|
|
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
|
|
|
title="Mozilla Bug 765063">
|
|
|
|
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
|
2012-09-05 10:08:54 -07:00
|
|
|
<script type="application/javascript" src="head.js"/>
|
|
|
|
<!-- test results are displayed in the html:body -->
|
|
|
|
<body xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=741549"
|
|
|
|
target="_blank">Mozilla Bug 765063</a>
|
|
|
|
</body>
|
2012-07-05 11:12:55 -07:00
|
|
|
|
|
|
|
<script>
|
2012-09-05 10:08:54 -07:00
|
|
|
|
2012-07-05 11:12:55 -07:00
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
2012-09-05 10:08:54 -07:00
|
|
|
makeAllAppsLaunchable();
|
|
|
|
|
|
|
|
var url = "http://test/chrome/dom/tests/mochitest/webapps/apps/basic.webapp";
|
|
|
|
|
2012-07-14 02:38:56 -07:00
|
|
|
// Observe app installation and confirm that the install origin didn't change.
|
|
|
|
var observer = {
|
|
|
|
observe: function observe(subject, topic, data) {
|
|
|
|
Services.obs.removeObserver(observer, "webapps-sync-install");
|
2012-09-05 10:08:54 -07:00
|
|
|
is(JSON.parse(data).installOrigin, "http://test",
|
2012-07-14 02:38:56 -07:00
|
|
|
"the install origin didn't change");
|
2012-09-05 10:08:54 -07:00
|
|
|
|
|
|
|
navigator.mozApps.mgmt.getAll().onsuccess = function onGetAll() {
|
2012-12-21 03:47:52 -08:00
|
|
|
var app = [a for (a of this.result) if (a.manifestURL == url)][0];
|
2012-09-05 10:08:54 -07:00
|
|
|
app.uninstall().onsuccess = function onUninstall() {
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
}
|
2012-07-05 11:12:55 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-07-14 02:38:56 -07:00
|
|
|
Components.utils.import("resource://gre/modules/Services.jsm");
|
|
|
|
Services.obs.addObserver(observer, "webapps-sync-install", false);
|
2012-09-05 10:08:54 -07:00
|
|
|
|
|
|
|
// We call this here, even though the app is installed by the helper page,
|
|
|
|
// because the helper page redirect would cause its install listener to unload
|
|
|
|
// before it can confirm the install.
|
|
|
|
confirmNextInstall();
|
|
|
|
|
2012-07-05 11:12:55 -07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<!-- Load a page that initiates an app installation and then immediately
|
|
|
|
- redirects to a page at a different origin. We can't do this directly
|
|
|
|
- inside this test page, because that would cause the test to hang. -->
|
2012-09-05 10:08:54 -07:00
|
|
|
<iframe src="http://test/chrome/dom/tests/mochitest/webapps/bug_765063.xul"/>
|
2012-07-05 11:12:55 -07:00
|
|
|
|
|
|
|
</window>
|