content/html/content/test/test_bug332893-7.html

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.

michael@0 1 <!DOCTYPE html>
michael@0 2 <html>
michael@0 3 <head>
michael@0 4 <title>Test</title>
michael@0 5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 6 </head>
michael@0 7 <body>
michael@0 8 <form id="form1">
michael@0 9 <input id="input1" type="input" name="input" value="1"/>
michael@0 10 <input id="input2" type="input" name="input" value="2"/>
michael@0 11 <input id="input3" type="input" name="input" value="3"/>
michael@0 12 <input id="input4" type="input" name="input" value="4"/>
michael@0 13 <input id="input5" type="input" name="input" value="5"/>
michael@0 14 <input id="input6" type="input" name="input" value="6"/>
michael@0 15 <input id="input7" type="input" name="input" value="7"/>
michael@0 16 <input id="input8" type="input" name="input" value="8"/>
michael@0 17 <input id="input9" type="input" name="input" value="9"/>
michael@0 18 <input id="input10" type="input" name="input" value="10"/>
michael@0 19
michael@0 20
michael@0 21
michael@0 22
michael@0 23 </form>
michael@0 24 <script>
michael@0 25 var input1 = document.getElementById("input1");
michael@0 26 var input2 = document.getElementById("input2");
michael@0 27 var input3 = document.getElementById("input3");
michael@0 28 var input4 = document.getElementById("input4");
michael@0 29 var input5 = document.getElementById("input5");
michael@0 30 var input6 = document.getElementById("input6");
michael@0 31 var input7 = document.getElementById("input7");
michael@0 32 var input8 = document.getElementById("input8");
michael@0 33 var input9 = document.getElementById("input9");
michael@0 34 var input10 = document.getElementById("input10");
michael@0 35
michael@0 36
michael@0 37 var form1 = document.getElementById("form1");
michael@0 38
michael@0 39 form1.insertBefore(input2, input1);
michael@0 40 form1.insertBefore(input10, input6);
michael@0 41 form1.insertBefore(input8, input4);
michael@0 42 form1.insertBefore(input9, input2);
michael@0 43
michael@0 44 is(form1.elements["input"].length, "10", "Form 1 'input' has the correct length");
michael@0 45 is(form1.elements["input"][0].value, "9", "Form 1 element 1 is correct");
michael@0 46 is(form1.elements["input"][1].value, "2", "Form 1 element 2 is correct");
michael@0 47 is(form1.elements["input"][2].value, "1", "Form 1 element 3 is correct");
michael@0 48 is(form1.elements["input"][3].value, "3", "Form 1 element 4 is correct");
michael@0 49 is(form1.elements["input"][4].value, "8", "Form 1 element 5 is correct");
michael@0 50 is(form1.elements["input"][5].value, "4", "Form 1 element 6 is correct");
michael@0 51 is(form1.elements["input"][6].value, "5", "Form 1 element 7 is correct");
michael@0 52 is(form1.elements["input"][7].value, "10", "Form 1 element 8 is correct");
michael@0 53 is(form1.elements["input"][8].value, "6", "Form 1 element 9 is correct");
michael@0 54 is(form1.elements["input"][9].value, "7", "Form 1 element 10 is correct");
michael@0 55
michael@0 56 is(form1.elements["input"][0].id, "input9", "Form 1 element 1 id is correct");
michael@0 57 is(form1.elements["input"][1].id, "input2", "Form 1 element 2 id is correct");
michael@0 58 is(form1.elements["input"][2].id, "input1", "Form 1 element 3 id is correct");
michael@0 59 is(form1.elements["input"][3].id, "input3", "Form 1 element 4 id is correct");
michael@0 60 is(form1.elements["input"][4].id, "input8", "Form 1 element 5 id is correct");
michael@0 61 is(form1.elements["input"][5].id, "input4", "Form 1 element 6 id is correct");
michael@0 62 is(form1.elements["input"][6].id, "input5", "Form 1 element 7 id is correct");
michael@0 63 is(form1.elements["input"][7].id, "input10", "Form 1 element 8 id is correct");
michael@0 64 is(form1.elements["input"][8].id, "input6", "Form 1 element 9 id is correct");
michael@0 65 is(form1.elements["input"][9].id, "input7", "Form 1 element 10 id is correct");
michael@0 66
michael@0 67 </script>
michael@0 68 </body>
michael@0 69 </html>

mercurial