diff options
Diffstat (limited to '')
-rw-r--r-- | dom/base/test/test_input_vsync_alignment_input_while_vsync.html | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/dom/base/test/test_input_vsync_alignment_input_while_vsync.html b/dom/base/test/test_input_vsync_alignment_input_while_vsync.html new file mode 100644 index 0000000000..6d1ac469fe --- /dev/null +++ b/dom/base/test/test_input_vsync_alignment_input_while_vsync.html @@ -0,0 +1,47 @@ +<!DOCTYPE HTML> +<html> +<head> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <script src="/tests/SimpleTest/EventUtils.js"></script> + <link rel="stylesheet" href="/tests/SimpleTest/test.css"> +</head> +<body > +<input /> +<script type="text/javascript"> + SimpleTest.waitForExplicitFinish(); + + function triggerKey() { + SpecialPowers.loadChromeScript(() => { + /* eslint-env mozilla/chrome-script */ + var win = Services.wm.getMostRecentBrowserWindow(); + for (let i = 0; i < 200; ++i) { + EventUtils.synthesizeKey("a", {}, win); + } + }); + } + + function runTest() { + const input = document.querySelector("input"); + input.focus(); + + let didInputRun = false; + + input.addEventListener("input", function() { + if (!didInputRun) { + didInputRun = true; + window.requestAnimationFrame(() => { + var xhr = new XMLHttpRequest(); + xhr.open("GET", "slow.sjs", false); + xhr.send(); + ok(true, "Didn't crash!"); + SimpleTest.finish(); + }); + } + }); + + triggerKey(); + } + runTest(); +</script> +</body> +</html> |