Bug 1044074 - Add test that scroll event handlers do not break run-to-completion, no_r.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 24 Dec 2018 05:52:31 -1000
changeset 451892 5327afef99b0ab315a0ba93c0ceb0caab565d857
parent 451891 191dfb7c9ac3d9bab913e3eb09c24f9a6810ea8a
child 451893 0621040311260830908b35fbeebd42041911c531
push id110759
push userbhackett@mozilla.com
push dateMon, 24 Dec 2018 23:40:35 +0000
treeherdermozilla-inbound@062104031126 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1044074
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1044074 - Add test that scroll event handlers do not break run-to-completion, no_r.
devtools/client/debugger/new/test/mochitest/browser.ini
devtools/client/debugger/new/test/mochitest/browser_dbg-scroll-run-to-completion.js
devtools/client/debugger/new/test/mochitest/examples/doc-scroll-run-to-completion.html
--- a/devtools/client/debugger/new/test/mochitest/browser.ini
+++ b/devtools/client/debugger/new/test/mochitest/browser.ini
@@ -587,16 +587,17 @@ support-files =
   examples/doc-react.html
   examples/wasm-sourcemaps/fib.c
   examples/wasm-sourcemaps/fib.wasm
   examples/wasm-sourcemaps/fib.wasm.map
   examples/wasm-sourcemaps/utils.js
   examples/fetch.js
   examples/doc-xhr.html
   examples/doc-xhr-run-to-completion.html
+  examples/doc-scroll-run-to-completion.html
   examples/sum/sum.js
   examples/sum/sum.min.js
   examples/sum/sum.min.js.map
   examples/big-sourcemap_files/bundle.js
   examples/big-sourcemap_files/bundle.js.map
   examples/reload/code_reload_1.js
   examples/reload/code_reload_2.js
   examples/reload/doc-reload.html
@@ -657,16 +658,17 @@ support-files =
   examples/doc_rr_error.html
 
 [browser_dbg-asm.js]
 [browser_dbg-async-stepping.js]
 [browser_dbg-sourcemapped-breakpoint-console.js]
 skip-if = (os == "win" && ccov) # Bug 1453549
 [browser_dbg-xhr-breakpoints.js]
 [browser_dbg-xhr-run-to-completion.js]
+[browser_dbg-scroll-run-to-completion.js]
 [browser_dbg-sourcemapped-scopes.js]
 skip-if = ccov || (verify && debug && (os == 'linux')) # Bug 1441545
 [browser_dbg-sourcemapped-stepping.js]
 skip-if = (os == 'win' && os_version == '10.0' && ccov) # Bug 1480680
 [browser_dbg-sourcemapped-preview.js]
 skip-if = os == "win" # Bug 1448523, Bug 1448450
 [browser_dbg-breaking.js]
 [browser_dbg-breaking-from-console.js]
new file mode 100644
--- /dev/null
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-scroll-run-to-completion.js
@@ -0,0 +1,19 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+add_task(async function() {
+  const dbg = await initDebugger("doc-scroll-run-to-completion.html");
+  invokeInTab("pauseOnce", "doc-scroll-run-to-completion.html");
+  await waitForPaused(dbg);
+  assertPausedLocation(dbg);
+
+  const threadClient = dbg.toolbox.threadClient;
+  await checkEvaluateInTopFrame(threadClient, 'window.scrollBy(0, 10);', undefined);
+
+  // checkEvaluateInTopFrame does an implicit resume for some reason.
+  await waitForPaused(dbg);
+
+  resume(dbg);
+  await once(Services.ppmm, "test passed");
+});
new file mode 100644
--- /dev/null
+++ b/devtools/client/debugger/new/test/mochitest/examples/doc-scroll-run-to-completion.html
@@ -0,0 +1,27 @@
+ <!-- This Source Code Form is subject to the terms of the Mozilla Public
+    - License, v. 2.0. If a copy of the MPL was not distributed with this
+    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+<!DOCTYPE html>
+<meta charset=UTF-8>
+<body></body>
+<script>
+const cpmm = SpecialPowers.Services.cpmm;
+var result;
+
+for (var i = 0; i < 100; i++) {
+var div = document.createElement("div");
+div.innerHTML = "Hello World!";
+document.body.insertBefore(div, document.body.firstChild);
+}
+
+async function pauseOnce() {
+    window.addEventListener('scroll', done);
+    result = "test failed";
+    debugger;
+    result = "test passed";
+}
+
+function done() {
+    cpmm.sendAsyncMessage(result);
+}
+</script>