widget/tests/test_picker_no_crash.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.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4   <title>Test for crashes when the parent window of a file picker is closed via script</title>
     5   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     6   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     7 </head>
     9 <script type="application/javascript">
    11 SimpleTest.waitForExplicitFinish();
    13 var childWindow;
    15 function testStepOne() {
    16   childWindow = window.open('window_picker_no_crash_child.html', 'childWindow', 'width=300,height=150');
    17   SimpleTest.waitForFocus(testStepTwo, childWindow);
    18 }
    20 function testStepTwo() {
    21   childWindow.document.form1.uploadbox.click();
    22   // This should not crash the browser
    23   childWindow.close();
    24   setTimeout("testStepThree();", 5000);
    25 }
    27 function testStepThree() {
    28   ok(true, "browser didn't crash");
    29   SimpleTest.finish();
    30 }
    32 SimpleTest.waitForFocus(testStepOne);
    33 </script>
    34 </body>
    35 </html>

mercurial