widget/tests/test_picker_no_crash.html

branch
TOR_BUG_9701
changeset 10
ac0c01689b40
equal deleted inserted replaced
-1:000000000000 0:ff26d3862c25
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>
8
9 <script type="application/javascript">
10
11 SimpleTest.waitForExplicitFinish();
12
13 var childWindow;
14
15 function testStepOne() {
16 childWindow = window.open('window_picker_no_crash_child.html', 'childWindow', 'width=300,height=150');
17 SimpleTest.waitForFocus(testStepTwo, childWindow);
18 }
19
20 function testStepTwo() {
21 childWindow.document.form1.uploadbox.click();
22 // This should not crash the browser
23 childWindow.close();
24 setTimeout("testStepThree();", 5000);
25 }
26
27 function testStepThree() {
28 ok(true, "browser didn't crash");
29 SimpleTest.finish();
30 }
31
32 SimpleTest.waitForFocus(testStepOne);
33 </script>
34 </body>
35 </html>

mercurial