Backed out changeset 85797ddca854 (bug 1532584) for perma failing browser_markup_events_chrome_not_blocked.js CLOSED TREE
authorCiure Andrei <aciure@mozilla.com>
Thu, 07 Mar 2019 19:52:33 +0200
changeset 520858 9f2370857fa0763d778435e8819724125ba84c6b
parent 520857 9f7170a27e4cfd08afa9026dbf9b826582bbed35
child 520859 4256ff8a181c94740e6387f7b7618d314fd56d71
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1532584
milestone67.0a1
backs out85797ddca8546f5b5248545973e03631f4a1f34e
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
Backed out changeset 85797ddca854 (bug 1532584) for perma failing browser_markup_events_chrome_not_blocked.js CLOSED TREE
devtools/client/inspector/markup/test/browser_markup_events_chrome_blocked.js
devtools/client/inspector/markup/test/browser_markup_events_chrome_not_blocked.js
devtools/client/inspector/markup/test/doc_markup_events_chrome_listeners.html
devtools/client/inspector/markup/test/helper_events_test_runner.js
--- a/devtools/client/inspector/markup/test/browser_markup_events_chrome_blocked.js
+++ b/devtools/client/inspector/markup/test/browser_markup_events_chrome_blocked.js
@@ -1,40 +1,26 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  http://creativecommons.org/publicdomain/zero/1.0/ */
 /* import-globals-from helper_events_test_runner.js */
 
 "use strict";
 
-// Test that markup view chrome event bubbles are hidden when
-// devtools.chrome.enabled = false.
+// Test that markup view event bubbles are hidden for <video> tags in the
+// content process when devtools.chrome.enabled=false.
+// <video> tags have 22 chrome listeners.
 
 const TEST_URL = URL_ROOT + "doc_markup_events_chrome_listeners.html";
 
 loadHelperScript("helper_events_test_runner.js");
 
 const TEST_DATA = [
   {
-    selector: "div",
+    selector: "video",
     expected: [ ],
   },
 ];
 
 add_task(async function() {
   await pushPref("devtools.chrome.enabled", false);
-
-  const {tab, inspector, testActor} = await openInspectorForURL(TEST_URL);
-  const browser = tab.linkedBrowser;
-  const mm = browser.messageManager;
-
-  await mm.loadFrameScript(
-    `data:,const div = content.document.querySelector("div");` +
-    `div.addEventListener("click", () => {` +
-    ` /* Do nothing */` +
-    `});`, false);
-
-  await inspector.markup.expandAll();
-
-  for (const test of TEST_DATA) {
-    await checkEventsForNode(test, inspector, testActor);
-  }
+  await runEventPopupTests(TEST_URL, TEST_DATA);
 });
--- a/devtools/client/inspector/markup/test/browser_markup_events_chrome_not_blocked.js
+++ b/devtools/client/inspector/markup/test/browser_markup_events_chrome_not_blocked.js
@@ -1,51 +1,74 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  http://creativecommons.org/publicdomain/zero/1.0/ */
 /* import-globals-from helper_events_test_runner.js */
 
 "use strict";
 
-// Test that markup view chrome event bubbles are shown when
-// devtools.chrome.enabled = true.
+// Test that markup view event bubbles are shown for <video> tags in the
+// content process when devtools.chrome.enabled=true.
 
 const TEST_URL = URL_ROOT + "doc_markup_events_chrome_listeners.html";
 
 loadHelperScript("helper_events_test_runner.js");
 
 const TEST_DATA = [
   {
-    selector: "div",
+    selector: "video",
     expected: [
-      {
-        type: "click",
-        filename: `data:,const div = content.document.querySelector("div");` +
-                  `div.addEventListener("click", () => { /* Do nothing */});:1`,
-        attributes: [
-          "Bubbling",
-          "DOM2",
-        ],
-        handler: `() => { /* Do nothing */ }`,
-      },
+      createEvent("canplay"),
+      createEvent("canplaythrough"),
+      createEvent("emptied"),
+      createEvent("ended"),
+      createEvent("error"),
+      createEvent("keypress"),
+      createEvent("loadeddata"),
+      createEvent("loadedmetadata"),
+      createEvent("loadstart"),
+      createEvent("mozvideoonlyseekbegin"),
+      createEvent("mozvideoonlyseekcompleted"),
+      createEvent("pause"),
+      createEvent("play"),
+      createEvent("playing"),
+      createEvent("progress"),
+      createEvent("seeked"),
+      createEvent("seeking"),
+      createEvent("stalled"),
+      createEvent("suspend"),
+      createEvent("timeupdate"),
+      createEvent("volumechange"),
+      createEvent("waiting"),
     ],
   },
 ];
 
+function createEvent(type) {
+  return {
+    type: type,
+    filename: "chrome://global/content/elements/videocontrols.js:437",
+    attributes: [
+      "Capturing",
+      "DOM2",
+    ],
+    handler: `
+      ${type === "play" ? "function" : "handleEvent"}(aEvent) {
+        if (!aEvent.isTrusted) {
+          this.log("Drop untrusted event ----> " + aEvent.type);
+          return;
+        }
+
+        this.log("Got event ----> " + aEvent.type);
+
+        if (this.videoEvents.includes(aEvent.type)) {
+          this.handleVideoEvent(aEvent);
+        } else {
+          this.handleControlEvent(aEvent);
+        }
+      }`,
+  };
+}
+
 add_task(async function() {
   await pushPref("devtools.chrome.enabled", true);
-
-  const {tab, inspector, testActor} = await openInspectorForURL(TEST_URL);
-  const browser = tab.linkedBrowser;
-  const mm = browser.messageManager;
-
-  await mm.loadFrameScript(
-    `data:,const div = content.document.querySelector("div");` +
-    `div.addEventListener("click", () => {` +
-    ` /* Do nothing */` +
-    `});`, false);
-
-  await inspector.markup.expandAll();
-
-  for (const test of TEST_DATA) {
-    await checkEventsForNode(test, inspector, testActor);
-  }
+  await runEventPopupTests(TEST_URL, TEST_DATA);
 });
--- a/devtools/client/inspector/markup/test/doc_markup_events_chrome_listeners.html
+++ b/devtools/client/inspector/markup/test/doc_markup_events_chrome_listeners.html
@@ -1,9 +1,9 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
 	<meta charset="utf-8">
 </head>
 <body>
-	<div></div>
+	<video controls></video>
 </body>
 </html>
\ No newline at end of file
--- a/devtools/client/inspector/markup/test/helper_events_test_runner.js
+++ b/devtools/client/inspector/markup/test/helper_events_test_runner.js
@@ -89,18 +89,17 @@ async function checkEventsForNode(test, 
   }
 
   // Check values
   const headers = tooltip.panel.querySelectorAll(".event-header");
   const nodeFront = container.node;
   const cssSelector = nodeFront.nodeName + "#" + nodeFront.id;
 
   for (let i = 0; i < headers.length; i++) {
-    const label = `${cssSelector}.${expected[i].type} (index ${i})`;
-    info(`${label} START`);
+    info("Processing header[" + i + "] for " + cssSelector);
 
     const header = headers[i];
     const type = header.querySelector(".event-tooltip-event-type");
     const filename = header.querySelector(".event-tooltip-filename");
     const attributes = header.querySelectorAll(".event-tooltip-attributes");
     const contentBox = header.nextElementSibling;
 
     info("Looking for " + type.textContent);
@@ -132,23 +131,19 @@ async function checkEventsForNode(test, 
         "We are in expanded state and icon changed");
 
     const editor = tooltip.eventTooltip._eventEditors.get(contentBox).editor;
     const tidiedHandler = beautify.js(expected[i].handler, {
       "indent_size": 2,
     });
     testDiff(editor.getText(), tidiedHandler,
        "handler matches for " + cssSelector, ok);
-
-    info(`${label} END`);
   }
 
-  const tooltipHidden = tooltip.once("hidden");
   tooltip.hide();
-  await tooltipHidden;
 }
 
 /**
  * Create diff of two strings.
  *
  * @param  {String} text1
  *         String to compare with text2.
  * @param  {String} text2 [description]