Backed out changeset 2f3dd84d4d22 (bug 1407178) for frequently failing enabled test. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 11 Oct 2017 17:13:07 +0200
changeset 385570 a97a53dfbaeb7373969c73a39f6e4c004577aa23
parent 385569 1ac7fce0b369889c60010e66085d2bf0eb8bc250
child 385571 1b4489e6564176ce6e6219048d8bda819146c28f
push id53073
push userarchaeopteryx@coole-files.de
push dateWed, 11 Oct 2017 15:13:24 +0000
treeherderautoland@a97a53dfbaeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1407178
milestone58.0a1
backs out2f3dd84d4d228a6a52f47164eabd1298ed26ebe9
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 2f3dd84d4d22 (bug 1407178) for frequently failing enabled test. r=backout
devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_certificate_messages.js
devtools/client/webconsole/new-console-output/test/mochitest/head.js
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
@@ -247,16 +247,18 @@ skip-if = true #	Bug 1403899
 # old console skip-if = (os == 'win' && bits == 64) # Bug 1390001
 [browser_webconsole_cached_autocomplete.js]
 skip-if = true # Bug 1401881
 [browser_webconsole_cached_messages.js]
 skip-if = true #	Bug 1406069
 [browser_webconsole_cd_iframe.js]
 skip-if = true #	Bug 1406030
 [browser_webconsole_certificate_messages.js]
+skip-if = true # Bug 1401881
+# old console skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s
 [browser_webconsole_charset.js]
 skip-if = true #	Bug 1404400
 [browser_webconsole_chrome.js]
 skip-if = true # Bug 1401881
 [browser_webconsole_click_function_to_source.js]
 skip-if = true #	Bug 1406038
 [browser_webconsole_clickable_urls.js]
 [browser_webconsole_closing_after_completion.js]
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_certificate_messages.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_certificate_messages.js
@@ -2,47 +2,80 @@
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Tests that the Web Console shows weak crypto warnings (SHA-1 Certificate)
 
 "use strict";
 
-const TEST_URI = "data:text/html;charset=utf8,Web Console weak crypto warnings test";
-const TEST_URI_PATH = "/browser/devtools/client/webconsole/new-console-output/test/" +
-                      "mochitest/test-certificate-messages.html";
+const TEST_URI = "data:text/html;charset=utf8,Web Console weak crypto " +
+                 "warnings test";
+const TEST_URI_PATH = "/browser/devtools/client/webconsole/test/" +
+                      "test-certificate-messages.html";
 
-var tests = [{
-  url: "https://sha1ee.example.com" + TEST_URI_PATH,
-  name: "SHA1 warning displayed successfully",
-  warning: ["SHA-1"],
-  nowarning: ["SSL 3.0", "RC4"]
-}, {
-  url: "https://sha256ee.example.com" + TEST_URI_PATH,
-  name: "SSL warnings appropriately not present",
-  warning: [],
-  nowarning: ["SHA-1", "SSL 3.0", "RC4"]
-}];
+var gWebconsoleTests = [
+  {url: "https://sha1ee.example.com" + TEST_URI_PATH,
+   name: "SHA1 warning displayed successfully",
+   warning: ["SHA-1"], nowarning: ["SSL 3.0", "RC4"]},
+  {url: "https://sha256ee.example.com" + TEST_URI_PATH,
+   name: "SSL warnings appropriately not present",
+   warning: [], nowarning: ["SHA-1", "SSL 3.0", "RC4"]},
+];
 const TRIGGER_MSG = "If you haven't seen ssl warnings yet, you won't";
 
-add_task(async function () {
-  const hud = await openNewTabAndConsole(TEST_URI);
-  for (let test of tests) {
-    await runTest(test, hud);
-  }
-});
+var gHud = undefined, gContentBrowser;
+var gCurrentTest;
+
+function test() {
+  registerCleanupFunction(function () {
+    gHud = gContentBrowser = null;
+  });
+
+  loadTab(TEST_URI).then(({browser}) => {
+    gContentBrowser = browser;
+    openConsole().then(runTestLoop);
+  });
+}
 
-async function runTest(test, hud) {
-  info(`Testing ${test.name}`);
-  await loadDocument(test.url);
-  await waitFor(() => findMessage(hud, TRIGGER_MSG));
-
-  for (let warning of test.warning) {
-    ok(hud.outputNode.textContent.indexOf(warning) >= 0,
-      `There is a warning message for ${warning}`);
+function runTestLoop(theHud) {
+  gCurrentTest = gWebconsoleTests.shift();
+  if (!gCurrentTest) {
+    finishTest();
+    return;
+  }
+  if (!gHud) {
+    gHud = theHud;
   }
-
-  for (let nowarning of test.nowarning) {
-    ok(hud.outputNode.textContent.indexOf(nowarning) < 0,
-      `There is no warning message for ${nowarning}`);
+  gHud.jsterm.clearOutput();
+  gContentBrowser.addEventListener("load", onLoad, true);
+  if (gCurrentTest.pref) {
+    SpecialPowers.pushPrefEnv({"set": gCurrentTest.pref},
+      function () {
+        BrowserTestUtils.loadURI(gBrowser.selectedBrowser, gCurrentTest.url);
+      });
+  } else {
+    BrowserTestUtils.loadURI(gBrowser.selectedBrowser, gCurrentTest.url);
   }
 }
+
+function onLoad() {
+  gContentBrowser.removeEventListener("load", onLoad, true);
+
+  waitForSuccess({
+    name: gCurrentTest.name,
+    validator: function () {
+      if (gHud.outputNode.textContent.indexOf(TRIGGER_MSG) >= 0) {
+        for (let warning of gCurrentTest.warning) {
+          if (gHud.outputNode.textContent.indexOf(warning) < 0) {
+            return false;
+          }
+        }
+        for (let nowarning of gCurrentTest.nowarning) {
+          if (gHud.outputNode.textContent.indexOf(nowarning) >= 0) {
+            return false;
+          }
+        }
+        return true;
+      }
+    }
+  }).then(runTestLoop);
+}
--- a/devtools/client/webconsole/new-console-output/test/mochitest/head.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/head.js
@@ -180,17 +180,17 @@ function hideContextMenu(hud) {
   let onPopupHidden = once(popup, "popuphidden");
   popup.hidePopup();
   return onPopupHidden;
 }
 
 function loadDocument(url, browser = gBrowser.selectedBrowser) {
   return new Promise(resolve => {
     browser.addEventListener("load", resolve, {capture: true, once: true});
-    BrowserTestUtils.loadURI(browser, url);
+    BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url);
   });
 }
 
 /**
 * Returns a promise that resolves when the node passed as an argument mutate
 * according to the passed configuration.
 *
 * @param {Node} node - The node to observe mutations on.