Thu, 15 Jan 2015 15:59:08 +0100
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.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=691 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>Test for Bug 691</title> |
michael@0 | 8 | <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 9 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
michael@0 | 10 | <script type="text/javascript"> |
michael@0 | 11 | |
michael@0 | 12 | function show(what) { |
michael@0 | 13 | var stage = document.getElementById("stage"); |
michael@0 | 14 | if (what == "modularity") { |
michael@0 | 15 | var spaghetti = document.createElement("IMG",null); |
michael@0 | 16 | spaghetti.setAttribute("SRC","nnc_lockup.gif"); |
michael@0 | 17 | spaghetti.setAttribute("id","foo"); |
michael@0 | 18 | stage.insertBefore(spaghetti,stage.firstChild); |
michael@0 | 19 | } |
michael@0 | 20 | } |
michael@0 | 21 | |
michael@0 | 22 | function remove() { |
michael@0 | 23 | var stage = document.getElementById("stage"); |
michael@0 | 24 | var body = document.getElementsByTagName("BODY")[0]; |
michael@0 | 25 | while (stage.firstChild) { |
michael@0 | 26 | stage.removeChild(stage.firstChild); |
michael@0 | 27 | } |
michael@0 | 28 | } |
michael@0 | 29 | |
michael@0 | 30 | </script> |
michael@0 | 31 | </head> |
michael@0 | 32 | <body> |
michael@0 | 33 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=691">Mozilla Bug 691</a> |
michael@0 | 34 | <p id="display"></p> |
michael@0 | 35 | <div id="content" > |
michael@0 | 36 | <ul> |
michael@0 | 37 | <li >foo</li> |
michael@0 | 38 | </ul> |
michael@0 | 39 | <div id="stage"> |
michael@0 | 40 | </div> |
michael@0 | 41 | |
michael@0 | 42 | </div> |
michael@0 | 43 | <pre id="test"> |
michael@0 | 44 | <script class="testbody" type="text/javascript"> |
michael@0 | 45 | |
michael@0 | 46 | /** Test for Bug 691 **/ |
michael@0 | 47 | |
michael@0 | 48 | show("modularity"); |
michael@0 | 49 | remove(); |
michael@0 | 50 | show("modularity"); |
michael@0 | 51 | remove(); |
michael@0 | 52 | show("modularity"); |
michael@0 | 53 | remove(); |
michael@0 | 54 | show("modularity"); |
michael@0 | 55 | |
michael@0 | 56 | ok($("foo"), "basic DOM manipulation doesn't crash"); |
michael@0 | 57 | |
michael@0 | 58 | </script> |
michael@0 | 59 | </pre> |
michael@0 | 60 | </body> |
michael@0 | 61 | </html> |
michael@0 | 62 |