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=870787 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>Test for Bug 870787</title> |
michael@0 | 8 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 9 | <script type="application/javascript" src="reflect.js"></script> |
michael@0 | 10 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 11 | </head> |
michael@0 | 12 | <body> |
michael@0 | 13 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=870787">Mozilla Bug 870787</a> |
michael@0 | 14 | |
michael@0 | 15 | <p id="msg"></p> |
michael@0 | 16 | |
michael@0 | 17 | <form id="form0"></form> |
michael@0 | 18 | <img name="img0" id="img0id"> |
michael@0 | 19 | |
michael@0 | 20 | <img name="img1" id="img1id" /> |
michael@0 | 21 | <form id="form1"> |
michael@0 | 22 | <img name="img2" id="img2id" /> |
michael@0 | 23 | </form> |
michael@0 | 24 | <img name="img3" id="img3id" /> |
michael@0 | 25 | |
michael@0 | 26 | <table> |
michael@0 | 27 | <form id="form2"> |
michael@0 | 28 | <tr><td> |
michael@0 | 29 | <button name="input1" id="input1id" /> |
michael@0 | 30 | <input name="input2" id="input2id" /> |
michael@0 | 31 | </form> |
michael@0 | 32 | </table> |
michael@0 | 33 | |
michael@0 | 34 | <table> |
michael@0 | 35 | <form id="form3"> |
michael@0 | 36 | <tr><td> |
michael@0 | 37 | <img name="img4" id="img4id" /> |
michael@0 | 38 | <img name="img5" id="img5id" /> |
michael@0 | 39 | </form> |
michael@0 | 40 | </table> |
michael@0 | 41 | |
michael@0 | 42 | <form id="form4"><img id="img6"></form> |
michael@0 | 43 | |
michael@0 | 44 | <pre id="test"> |
michael@0 | 45 | <script type="application/javascript"> |
michael@0 | 46 | |
michael@0 | 47 | /** Test for Bug 870787 **/ |
michael@0 | 48 | |
michael@0 | 49 | var form0 = document.getElementById("form0"); |
michael@0 | 50 | ok(form0, "Form0 exists"); |
michael@0 | 51 | ok(!form0.img0, "Form0.img0 doesn't exist"); |
michael@0 | 52 | ok(!form0.img0id, "Form0.img0id doesn't exist"); |
michael@0 | 53 | |
michael@0 | 54 | var form1 = document.getElementById("form1"); |
michael@0 | 55 | ok(form1, "Form1 exists"); |
michael@0 | 56 | ok(!form1.img1, "Form1.img1 doesn't exist"); |
michael@0 | 57 | ok(!form1.img1id, "Form1.img1id doesn't exist"); |
michael@0 | 58 | is(form1.img2, document.getElementById("img2id"), "Form1.img2 exists"); |
michael@0 | 59 | is(form1.img2id, document.getElementById("img2id"), "Form1.img2id exists"); |
michael@0 | 60 | ok(!form1.img3, "Form1.img3 doesn't exist"); |
michael@0 | 61 | ok(!form1.img3id, "Form1.img3id doesn't exist"); |
michael@0 | 62 | |
michael@0 | 63 | var form2 = document.getElementById("form2"); |
michael@0 | 64 | ok(form2, "Form2 exists"); |
michael@0 | 65 | is(form2.input1, document.getElementById("input1id"), "Form2.input1 exists"); |
michael@0 | 66 | is(form2.input1id, document.getElementById("input1id"), "Form2.input1id exists"); |
michael@0 | 67 | is(form2.input2, document.getElementById("input2id"), "Form2.input2 exists"); |
michael@0 | 68 | is(form2.input2id, document.getElementById("input2id"), "Form2.input2id exists"); |
michael@0 | 69 | |
michael@0 | 70 | var form3 = document.getElementById("form3"); |
michael@0 | 71 | ok(form3, "Form3 exists"); |
michael@0 | 72 | is(form3.img4, document.getElementById("img4id"), "Form3.img4 doesn't exists"); |
michael@0 | 73 | is(form3.img4id, document.getElementById("img4id"), "Form3.img4id doesn't exists"); |
michael@0 | 74 | is(form3.img5, document.getElementById("img5id"), "Form3.img5 doesn't exists"); |
michael@0 | 75 | is(form3.img5id, document.getElementById("img5id"), "Form3.img5id doesn't exists"); |
michael@0 | 76 | |
michael@0 | 77 | var form4 = document.getElementById("form4"); |
michael@0 | 78 | ok(form4, "Form4 exists"); |
michael@0 | 79 | is(Object.getOwnPropertyNames(form4.elements).indexOf("img6"), -1, "Form4.elements should not contain img6"); |
michael@0 | 80 | |
michael@0 | 81 | </script> |
michael@0 | 82 | </pre> |
michael@0 | 83 | </body> |
michael@0 | 84 | </html> |