Revision 6e71944f53c7c600dd5bc6bcbd2036a3de2f889b authored by Andrew McCreight on 19 February 2016, 14:26:07 UTC, committed by Andrew McCreight on 19 February 2016, 14:26:07 UTC
--HG--
extra : rebase_source : 0436f9afd1ac72615138e3a90fcf634ff036ecc2
extra : source : e1bd22460aeb4d6bc645b933f1901c28fee5dfd3
1 parent 845d455
Raw File
test_picker_no_crash.html
<!DOCTYPE HTML>
<html>
<head>
  <title>Test for crashes when the parent window of a file picker is closed via script</title>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>

<script type="application/javascript">

SimpleTest.waitForExplicitFinish();
SimpleTest.requestFlakyTimeout("untriaged");

var childWindow;

function testStepOne() {
  childWindow = window.open('window_picker_no_crash_child.html', 'childWindow', 'width=300,height=150');
  SimpleTest.waitForFocus(testStepTwo, childWindow);
}

function testStepTwo() {
  childWindow.document.form1.uploadbox.click();
  // This should not crash the browser
  childWindow.close();
  setTimeout("testStepThree();", 5000);
}

function testStepThree() {
  ok(true, "browser didn't crash");
  SimpleTest.finish();
}

SimpleTest.waitForFocus(testStepOne);
</script>
</body>
</html>
back to top