|
1 <?xml version="1.0"?> |
|
2 |
|
3 <!-- Any copyright is dedicated to the Public Domain. |
|
4 - http://creativecommons.org/publicdomain/zero/1.0/ --> |
|
5 |
|
6 <?xml-stylesheet type="text/css" href="chrome://global/skin"?> |
|
7 <?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?> |
|
8 |
|
9 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
|
10 title="Mozilla Bug 765063"> |
|
11 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> |
|
12 <script type="application/javascript" src="head.js"/> |
|
13 <!-- test results are displayed in the html:body --> |
|
14 <body xmlns="http://www.w3.org/1999/xhtml"> |
|
15 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=741549" |
|
16 target="_blank">Mozilla Bug 765063</a> |
|
17 </body> |
|
18 |
|
19 <script> |
|
20 |
|
21 SimpleTest.waitForExplicitFinish(); |
|
22 |
|
23 SpecialPowers.setAllAppsLaunchable(true); |
|
24 |
|
25 var mmListener = { |
|
26 receiveMessage: function(aMessage) { |
|
27 ppmm.removeMessageListener("Webapps:Install", mmListener); |
|
28 |
|
29 var msg = aMessage.json; |
|
30 var ioService = Components.classes["@mozilla.org/network/io-service;1"] |
|
31 .getService(Components.interfaces.nsIIOService); |
|
32 var uri = ioService.newURI(msg.from, null, null); |
|
33 is(uri.prePath, "http://test", "the install origin didn't change"); |
|
34 |
|
35 SimpleTest.finish(); |
|
36 } |
|
37 }; |
|
38 |
|
39 var ppmm = Components.classes["@mozilla.org/parentprocessmessagemanager;1"] |
|
40 .getService(Components.interfaces.nsIMessageBroadcaster); |
|
41 ppmm.addMessageListener("Webapps:Install", mmListener); |
|
42 |
|
43 // We call this here, even though the app is installed by the helper page, |
|
44 // because the helper page redirect would cause its install listener to unload |
|
45 // before it can confirm the install. |
|
46 confirmNextInstall(); |
|
47 |
|
48 </script> |
|
49 |
|
50 <!-- Load a page that initiates an app installation and then immediately |
|
51 - redirects to a page at a different origin. We can't do this directly |
|
52 - inside this test page, because that would cause the test to hang. --> |
|
53 <iframe src="http://test/chrome/dom/tests/mochitest/webapps/install_and_redirect_helper.xul"/> |
|
54 |
|
55 </window> |