dom/tests/mochitest/webapps/test_bug_765063.xul

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

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

mercurial