Backed out changeset 76d24a5414eb (bug 1429721) for devtools failure on browser_net_headers-alignment.js. on a CLOSED TREE
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Fri, 12 Jan 2018 09:49:16 +0200
changeset 453261 74e94759584cda78f2c715bbb8a5c3ab1c524e37
parent 453260 ed6f1ea151c1eb56e2d45da039e7694bce70f32a
child 453262 218077e821156a9b9c03eb1e70740558284ad1d0
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1429721
milestone59.0a1
backs out76d24a5414eb18d4c3b98fe56e3009e14589d857
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 76d24a5414eb (bug 1429721) for devtools failure on browser_net_headers-alignment.js. on a CLOSED TREE
devtools/client/netmonitor/src/assets/styles/RequestList.css
devtools/client/netmonitor/src/constants.js
devtools/client/netmonitor/test/browser_net_columns_pref.js
devtools/client/netmonitor/test/browser_net_columns_showhide.js
devtools/client/netmonitor/test/browser_net_headers-alignment.js
devtools/client/netmonitor/test/head.js
--- a/devtools/client/netmonitor/src/assets/styles/RequestList.css
+++ b/devtools/client/netmonitor/src/assets/styles/RequestList.css
@@ -324,16 +324,22 @@
 }
 
 /* Scheme column */
 
 .requests-list-scheme {
   width: 8%;
 }
 
+/* Domain column */
+
+.requests-list-domain {
+  width: 13%;
+}
+
 /* Start Time column */
 
 .requests-list-start-time {
   width: 8%;
 }
 
 /* End Time column */
 
@@ -354,25 +360,17 @@
 }
 
 /* Latency column */
 
 .requests-list-latency {
   width: 8%;
 }
 
-/* Response header columns */
-
 .requests-list-response-header {
-  width: 10%;
-}
-
-/* Domain column */
-
-.requests-list-domain {
   width: 13%;
 }
 
 .requests-list-domain.requests-list-column {
   text-align: start;
 }
 
 .requests-security-state-icon {
--- a/devtools/client/netmonitor/src/constants.js
+++ b/devtools/client/netmonitor/src/constants.js
@@ -245,17 +245,16 @@ const HEADERS = [
   {
     name: "latency",
     canFilter: false,
     subMenu: "timings",
   },
   ...RESPONSE_HEADERS
     .map(header => ({
       name: header,
-      boxName: "response-header",
       canFilter: false,
       subMenu: "responseHeaders",
       noLocalization: true
     })),
   {
     name: "waterfall",
     canFilter: false,
   }
--- a/devtools/client/netmonitor/test/browser_net_columns_pref.js
+++ b/devtools/client/netmonitor/test/browser_net_columns_pref.js
@@ -40,30 +40,32 @@ add_task(function* () {
   );
 
   ok(visibleColumns.includes("status"),
     "Pref should be synced for status");
 
   function* hideColumn(column) {
     info(`Clicking context-menu item for ${column}`);
     EventUtils.sendMouseEvent({ type: "contextmenu" },
-      document.querySelector(".devtools-toolbar.requests-list-headers"));
+      document.querySelector("#requests-list-status-button") ||
+      document.querySelector("#requests-list-waterfall-button"));
 
     let onHeaderRemoved = waitForDOM(document, `#requests-list-${column}-button`, 0);
     parent.document.querySelector(`#request-list-header-${column}-toggle`).click();
 
     yield onHeaderRemoved;
     ok(!document.querySelector(`#requests-list-${column}-button`),
        `Column ${column} should be hidden`);
   }
 
   function* showColumn(column) {
     info(`Clicking context-menu item for ${column}`);
     EventUtils.sendMouseEvent({ type: "contextmenu" },
-      document.querySelector(".devtools-toolbar.requests-list-headers"));
+      document.querySelector("#requests-list-status-button") ||
+      document.querySelector("#requests-list-waterfall-button"));
 
     let onHeaderAdded = waitForDOM(document, `#requests-list-${column}-button`, 1);
     parent.document.querySelector(`#request-list-header-${column}-toggle`).click();
 
     yield onHeaderAdded;
     ok(document.querySelector(`#requests-list-${column}-button`),
        `Column ${column} should be visible`);
   }
--- a/devtools/client/netmonitor/test/browser_net_columns_showhide.js
+++ b/devtools/client/netmonitor/test/browser_net_columns_showhide.js
@@ -2,66 +2,56 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 /**
  * Test showing/hiding columns.
  */
 
-add_task(async function () {
-  let { monitor, tab } = await initNetMonitor(SIMPLE_URL);
+add_task(function* () {
+  let { monitor } = yield initNetMonitor(SIMPLE_URL);
   info("Starting test... ");
 
   let { document, store, parent } = monitor.panelWin;
 
-  let wait = waitForNetworkEvents(monitor, 1);
-  tab.linkedBrowser.loadURI(SIMPLE_URL);
-  await wait;
-
-  let requestsContainer = document.querySelector(".requests-list-contents");
-  ok(requestsContainer, "Container element exists as expected.");
-  let headers = document.querySelector(".requests-list-headers");
-
   let columns = store.getState().ui.columns;
   for (let column in columns) {
     if (columns[column]) {
-      await testVisibleColumnContextMenuItem(column, document, parent);
-      testColumnsAlignment(headers, requestsContainer);
-      await testHiddenColumnContextMenuItem(column, document, parent);
+      yield testVisibleColumnContextMenuItem(column, document, parent);
+      yield testHiddenColumnContextMenuItem(column, document, parent);
     } else {
-      await testHiddenColumnContextMenuItem(column, document, parent);
-      testColumnsAlignment(headers, requestsContainer);
-      await testVisibleColumnContextMenuItem(column, document, parent);
+      yield testHiddenColumnContextMenuItem(column, document, parent);
+      yield testVisibleColumnContextMenuItem(column, document, parent);
     }
   }
 
   columns = store.getState().ui.columns;
   for (let column in columns) {
     if (columns[column]) {
-      await testVisibleColumnContextMenuItem(column, document, parent);
+      yield testVisibleColumnContextMenuItem(column, document, parent);
       // Right click on the white-space for the context menu to appear
       // and toggle column visibility
-      await testWhiteSpaceContextMenuItem(column, document, parent);
+      yield testWhiteSpaceContextMenuItem(column, document, parent);
     }
   }
 });
 
-async function testWhiteSpaceContextMenuItem(column, document, parent) {
+function* testWhiteSpaceContextMenuItem(column, document, parent) {
   ok(!document.querySelector(`#requests-list-${column}-button`),
      `Column ${column} should be hidden`);
 
   info(`Right clicking on white-space in the header to get the context menu`);
   EventUtils.sendMouseEvent({ type: "contextmenu" },
     document.querySelector(".devtools-toolbar.requests-list-headers"));
 
-  await toggleAndCheckColumnVisibility(column, document, parent);
+  yield toggleAndCheckColumnVisibility(column, document, parent);
 }
 
-async function testVisibleColumnContextMenuItem(column, document, parent) {
+function* testVisibleColumnContextMenuItem(column, document, parent) {
   ok(document.querySelector(`#requests-list-${column}-button`),
      `Column ${column} should be visible`);
 
   info(`Clicking context-menu item for ${column}`);
   EventUtils.sendMouseEvent({ type: "contextmenu" },
     document.querySelector("#requests-list-status-button") ||
     document.querySelector("#requests-list-waterfall-button"));
 
@@ -71,43 +61,43 @@ async function testVisibleColumnContextM
      `${column} menu item should have type="checkbox" attribute`);
   is(menuItem.getAttribute("checked"), "true",
      `checked state of ${column} menu item should be correct`);
   ok(!menuItem.disabled, `disabled state of ${column} menu item should be correct`);
 
   let onHeaderRemoved = waitForDOM(document, `#requests-list-${column}-button`, 0);
   menuItem.click();
 
-  await onHeaderRemoved;
+  yield onHeaderRemoved;
 
   ok(!document.querySelector(`#requests-list-${column}-button`),
      `Column ${column} should be hidden`);
 }
 
-async function testHiddenColumnContextMenuItem(column, document, parent) {
+function* testHiddenColumnContextMenuItem(column, document, parent) {
   ok(!document.querySelector(`#requests-list-${column}-button`),
      `Column ${column} should be hidden`);
 
   info(`Clicking context-menu item for ${column}`);
   EventUtils.sendMouseEvent({ type: "contextmenu" },
     document.querySelector("#requests-list-status-button") ||
     document.querySelector("#requests-list-waterfall-button"));
 
-  await toggleAndCheckColumnVisibility(column, document, parent);
+  yield toggleAndCheckColumnVisibility(column, document, parent);
 }
 
-async function toggleAndCheckColumnVisibility(column, document, parent) {
+function* toggleAndCheckColumnVisibility(column, document, parent) {
   let menuItem = parent.document.querySelector(`#request-list-header-${column}-toggle`);
 
   is(menuItem.getAttribute("type"), "checkbox",
      `${column} menu item should have type="checkbox" attribute`);
   ok(!menuItem.getAttribute("checked"),
      `checked state of ${column} menu item should be correct`);
   ok(!menuItem.disabled, `disabled state of ${column} menu item should be correct`);
 
   let onHeaderAdded = waitForDOM(document, `#requests-list-${column}-button`, 1);
   menuItem.click();
 
-  await onHeaderAdded;
+  yield onHeaderAdded;
 
   ok(document.querySelector(`#requests-list-${column}-button`),
      `Column ${column} should be visible`);
 }
--- a/devtools/client/netmonitor/test/browser_net_headers-alignment.js
+++ b/devtools/client/netmonitor/test/browser_net_headers-alignment.js
@@ -2,54 +2,66 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 /**
  * Bug 1360457 - Mis-alignment between headers and columns on overflow
  */
 
-add_task(async function () {
+add_task(function* () {
   requestLongerTimeout(4);
 
-  let { tab, monitor } = await initNetMonitor(INFINITE_GET_URL, true);
+  let { tab, monitor } = yield initNetMonitor(INFINITE_GET_URL, true);
   let { document, windowRequire, store } = monitor.panelWin;
   let Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
 
   store.dispatch(Actions.batchEnable(false));
 
   // Wait until the first request makes the empty notice disappear
-  await waitForRequestListToAppear();
+  yield waitForRequestListToAppear();
 
   let requestsContainer = document.querySelector(".requests-list-contents");
   ok(requestsContainer, "Container element exists as expected.");
   let headers = document.querySelector(".requests-list-headers");
   ok(headers, "Headers element exists as expected.");
 
-  await waitForRequestsToOverflowContainer();
+  yield waitForRequestsToOverflowContainer();
+
+  // Get first request line, not child 0 as this is the headers
+  let firstRequestLine = requestsContainer.childNodes[1];
 
-  testColumnsAlignment(headers, requestsContainer);
+  // Find number of columns
+  let numberOfColumns = headers.childElementCount;
+  for (let columnNumber = 0; columnNumber < numberOfColumns; columnNumber++) {
+    let aHeaderColumn = headers.childNodes[columnNumber];
+    let aRequestColumn = firstRequestLine.childNodes[columnNumber];
+    is(aHeaderColumn.getBoundingClientRect().left,
+       aRequestColumn.getBoundingClientRect().left,
+       "Headers for columns number " + columnNumber + " are aligned."
+    );
+  }
 
   // Stop doing requests.
-  await ContentTask.spawn(tab.linkedBrowser, {}, function* () {
+  yield ContentTask.spawn(tab.linkedBrowser, {}, function* () {
     content.wrappedJSObject.stopRequests();
   });
 
   // Done: clean up.
   return teardown(monitor);
 
   function waitForRequestListToAppear() {
     info("Waiting until the empty notice disappears and is replaced with the list");
     return waitUntil(() => !!document.querySelector(".requests-list-contents"));
   }
-});
 
-async function waitForRequestsToOverflowContainer(monitor, requestList) {
-  info("Waiting for enough requests to overflow the container");
-  while (true) {
-    info("Waiting for one network request");
-    await waitForNetworkEvents(monitor, 1);
-    if (requestList.scrollHeight > requestList.clientHeight) {
-      info("The list is long enough, returning");
-      return;
+  function* waitForRequestsToOverflowContainer() {
+    info("Waiting for enough requests to overflow the container");
+    while (true) {
+      info("Waiting for one network request");
+      yield waitForNetworkEvents(monitor, 1);
+      if (requestsContainer.scrollHeight > requestsContainer.clientHeight) {
+        info("The list is long enough, returning");
+        return;
+      }
     }
   }
-}
+});
--- a/devtools/client/netmonitor/test/head.js
+++ b/devtools/client/netmonitor/test/head.js
@@ -1,16 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /* import-globals-from ../../framework/test/shared-head.js */
 /* exported Toolbox, restartNetMonitor, teardown, waitForExplicitFinish,
    verifyRequestItemTarget, waitFor, testFilterButtons, loadCommonFrameScript,
-   performRequestsInContent, waitForNetworkEvents, selectIndexAndWaitForSourceEditor,
-   testColumnsAlignment */
+   performRequestsInContent, waitForNetworkEvents, selectIndexAndWaitForSourceEditor */
 
 "use strict";
 
 // shared-head.js handles imports, constants, and utility functions
 Services.scriptloader.loadSubScript(
   "chrome://mochitests/content/browser/devtools/client/framework/test/shared-head.js",
   this);
 
@@ -685,32 +684,16 @@ function waitForContentMessage(name) {
   return new Promise((resolve) => {
     mm.addMessageListener(name, function onMessage(msg) {
       mm.removeMessageListener(name, onMessage);
       resolve(msg);
     });
   });
 }
 
-function testColumnsAlignment(headers, requestList) {
-  // Get first request line, not child 0 as this is the headers
-  let firstRequestLine = requestList.childNodes[1];
-
-  // Find number of columns
-  let numberOfColumns = headers.childElementCount;
-  for (let i = 0; i < numberOfColumns; i++) {
-    let headerColumn = headers.childNodes[i];
-    let requestColumn = firstRequestLine.childNodes[i];
-    is(headerColumn.getBoundingClientRect().left,
-       requestColumn.getBoundingClientRect().left,
-       "Headers for columns number " + i + " are aligned."
-    );
-  }
-}
-
 /**
  * Select a request and switch to its response panel.
  *
  * @param {Number} index The request index to be selected
  */
 async function selectIndexAndWaitForSourceEditor(monitor, index) {
   let document = monitor.panelWin.document;
   let onResponseContent = monitor.panelWin.once(EVENTS.RECEIVED_RESPONSE_CONTENT);