diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /widget/tests/test_picker_no_crash.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/tests/test_picker_no_crash.html')
-rw-r--r-- | widget/tests/test_picker_no_crash.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/widget/tests/test_picker_no_crash.html b/widget/tests/test_picker_no_crash.html new file mode 100644 index 0000000000..dbb75627b5 --- /dev/null +++ b/widget/tests/test_picker_no_crash.html @@ -0,0 +1,30 @@ +<!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> |