mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 00:32:11 +00:00
9a87a13d7c
This seems to consistently leak an nsFilePickerProxy, at least on Linux, tho... Differential Revision: https://phabricator.services.mozilla.com/D170758
31 lines
1.0 KiB
HTML
31 lines
1.0 KiB
HTML
<!DOCTYPE HTML>
|
|
<title>Test for crashes when the parent window of a file picker is closed via script</title>
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<script src="/tests/SimpleTest/EventUtils.js"></script>
|
|
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
|
|
<script>
|
|
SimpleTest.requestFlakyTimeout("testing we don't crash");
|
|
|
|
async function testPicker(id) {
|
|
let childWindow = window.open("window_picker_no_crash_child.html", "childWindow", "width=500,height=500");
|
|
await SimpleTest.promiseFocus(childWindow);
|
|
ok(!childWindow.clicked, "Shouldn't have clicked");
|
|
synthesizeMouseAtCenter(childWindow.document.getElementById(id), {}, childWindow);
|
|
ok(childWindow.clicked, "Should have clicked");
|
|
childWindow.close();
|
|
}
|
|
|
|
add_task(async function test_simple() {
|
|
await testPicker("uploadbox");
|
|
});
|
|
|
|
add_task(async function test_multiple() {
|
|
await testPicker("multiple");
|
|
});
|
|
|
|
add_task(async function wait() {
|
|
await new Promise(r => setTimeout(r, 1000));
|
|
ok(true, "browser didn't crash");
|
|
});
|
|
</script>
|