widget/tests/bug586713_window.xul

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 <?xml version="1.0"?>
     3 <!-- This Source Code Form is subject to the terms of the Mozilla Public
     4    - License, v. 2.0. If a copy of the MPL was not distributed with this
     5    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
     7 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     9 <window id="bug586713_window"
    10         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    11         width="300"
    12         height="300"
    13         onload="onLoad();"
    14         title="Bug 586713 Test">
    16   <menubar id="nativemenubar">
    17     <menu id="foo" label="Foo">
    18       <menupopup>
    19         <menuitem label="FooItem0"/>
    20       </menupopup>
    21     </menu>
    22   </menubar>
    24   <script type="application/javascript"><![CDATA[
    25     function ok(condition, message) {
    26       window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
    27     }
    29     function onTestsFinished() {
    30       window.close();
    31       window.opener.wrappedJSObject.SimpleTest.finish();
    32     }
    34     var fooCallCount = 0;
    35     function foo() {
    36       fooCallCount++;
    37       let instruction = document.createProcessingInstruction("xml-stylesheet", 'href="chrome://foo.css" type="text/css"');
    38       document.insertBefore(instruction, document.documentElement);
    39       if (fooCallCount == 2) {
    40         ok(true, "If we got here we didn't crash, excellent.");
    41         onTestsFinished();
    42       }
    43     }
    45     function onLoad() {
    46       foo();
    47       setTimeout(function() foo(), 0);
    48     }
    49   ]]></script>
    50 </window>

mercurial