widget/tests/test_picker_no_crash.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
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 for crashes when the parent window of a file picker is closed via script</title>
michael@0 5 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
michael@0 7 </head>
michael@0 8
michael@0 9 <script type="application/javascript">
michael@0 10
michael@0 11 SimpleTest.waitForExplicitFinish();
michael@0 12
michael@0 13 var childWindow;
michael@0 14
michael@0 15 function testStepOne() {
michael@0 16 childWindow = window.open('window_picker_no_crash_child.html', 'childWindow', 'width=300,height=150');
michael@0 17 SimpleTest.waitForFocus(testStepTwo, childWindow);
michael@0 18 }
michael@0 19
michael@0 20 function testStepTwo() {
michael@0 21 childWindow.document.form1.uploadbox.click();
michael@0 22 // This should not crash the browser
michael@0 23 childWindow.close();
michael@0 24 setTimeout("testStepThree();", 5000);
michael@0 25 }
michael@0 26
michael@0 27 function testStepThree() {
michael@0 28 ok(true, "browser didn't crash");
michael@0 29 SimpleTest.finish();
michael@0 30 }
michael@0 31
michael@0 32 SimpleTest.waitForFocus(testStepOne);
michael@0 33 </script>
michael@0 34 </body>
michael@0 35 </html>

mercurial