Bug 1404884 - Enable browser_webconsole_insecure_passwords_about_blank_web_console_warning.js in new console frontend; r=jdescottes. draft
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Tue, 23 Jan 2018 09:50:56 +0100
changeset 723435 965de788e3f222560427ee682a33ccc5a48ea383
parent 723434 b17f36c41c621ddef6a6894b8dc59a24012a8015
child 746855 48ef154931e06fb4425bb25f9f808583a4f634dd
push id96425
push userbmo:nchevobbe@mozilla.com
push dateTue, 23 Jan 2018 08:52:26 +0000
reviewersjdescottes
bugs1404884
milestone60.0a1
Bug 1404884 - Enable browser_webconsole_insecure_passwords_about_blank_web_console_warning.js in new console frontend; r=jdescottes. MozReview-Commit-ID: 7fQc3hOp8hT
devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_insecure_passwords_about_blank_web_console_warning.js
devtools/client/webconsole/new-console-output/test/mochitest/test-bug-762593-insecure-passwords-about-blank-web-console-warning.html
devtools/client/webconsole/new-console-output/test/mochitest/test-insecure-passwords-about-blank-web-console-warning.html
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
@@ -29,17 +29,16 @@ support-files =
   test-bug-601177-log-levels.html
   test-bug-601177-log-levels.js
   test-bug-630733-response-redirect-headers.sjs
   test-bug-632275-getters.html
   test-bug-644419-log-limits.html
   test-bug-646025-console-file-location.html
   test-bug-658368-time-methods.html
   test-bug-737873-mixedcontent.html
-  test-bug-762593-insecure-passwords-about-blank-web-console-warning.html
   test-bug-762593-insecure-passwords-web-console-warning.html
   test-bug-766001-console-log.js
   test-bug-766001-js-console-links.html
   test-bug-766001-js-errors.js
   test-bug-782653-css-errors-1.css
   test-bug-782653-css-errors-2.css
   test-bug-782653-css-errors.html
   test-bug-837351-security-errors.html
@@ -104,16 +103,17 @@ support-files =
   test-ineffective-iframe-sandbox-warning-nested1.html
   test-ineffective-iframe-sandbox-warning-nested2.html
   test-ineffective-iframe-sandbox-warning0.html
   test-ineffective-iframe-sandbox-warning1.html
   test-ineffective-iframe-sandbox-warning2.html
   test-ineffective-iframe-sandbox-warning3.html
   test-ineffective-iframe-sandbox-warning4.html
   test-ineffective-iframe-sandbox-warning5.html
+  test-insecure-passwords-about-blank-web-console-warning.html
   test-inspect-cross-domain-objects-frame.html
   test-inspect-cross-domain-objects-top.html
   test-jsterm-dollar.html
   test-location-debugger-link-console-log.js
   test-location-debugger-link-errors.js
   test-location-debugger-link.html
   test-location-styleeditor-link-1.css
   test-location-styleeditor-link-2.css
@@ -283,17 +283,16 @@ skip-if = true #	Bug 1404382
 [browser_webconsole_hpkp_invalid-headers.js]
 [browser_webconsole_hsts_invalid-headers.js]
 [browser_webconsole_iframe_wrong_hud.js]
 [browser_webconsole_ineffective_iframe_sandbox_warning.js]
 [browser_webconsole_init.js]
 [browser_webconsole_input_focus_on_panel_select.js]
 [browser_webconsole_input_focus.js]
 [browser_webconsole_insecure_passwords_about_blank_web_console_warning.js]
-skip-if = true #	Bug 1404884
 [browser_webconsole_insecure_passwords_web_console_warning.js]
 skip-if = true #	Bug 1404888
 # old console skip-if = true # Bug 1110500 - mouse event failure in test
 [browser_webconsole_inspect_cross_domain_object.js]
 [browser_webconsole_js_input_expansion.js]
 [browser_webconsole_jsterm.js]
 skip-if = true #	Bug 1405352
 # old console skip-if = e10s # Bug 1042253 - webconsole e10s tests (Linux debug timeout)
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_insecure_passwords_about_blank_web_console_warning.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_insecure_passwords_about_blank_web_console_warning.js
@@ -1,32 +1,21 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* 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 errors about insecure passwords are logged to the web console. See Bug 762593.
+// Tests that errors about insecure passwords are logged to the web console.
+// See Bug 762593.
 
 "use strict";
 
-const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
-                 "test/test-bug-762593-insecure-passwords-about-blank-web-console-warning.html";
-const INSECURE_PASSWORD_MSG = "Password fields present on an insecure " +
-  "(http://) iframe. This is a security risk that allows user login " +
-  "credentials to be stolen.";
-
-add_task(function* () {
-  yield loadTab(TEST_URI);
-
-  let hud = yield openConsole();
+const TEST_URI =
+  "http://example.com/browser/devtools/client/webconsole/new-console-output/test/" +
+  "mochitest/test-insecure-passwords-about-blank-web-console-warning.html";
+const INSECURE_PASSWORD_MSG = "Password fields present on an insecure (http://) iframe." +
+  " This is a security risk that allows user login credentials to be stolen.";
 
-  yield waitForMessages({
-    webconsole: hud,
-    messages: [
-      {
-        name: "Insecure password error displayed successfully",
-        text: INSECURE_PASSWORD_MSG,
-        category: CATEGORY_SECURITY,
-        severity: SEVERITY_WARNING
-      },
-    ],
-  });
+add_task(async function () {
+  const hud = await openNewTabAndConsole(TEST_URI);
+  await waitFor(()=> findMessage(hud, INSECURE_PASSWORD_MSG, ".message.warn"), "", 100);
+  ok(true, "Insecure password error displayed successfully");
 });
rename from devtools/client/webconsole/new-console-output/test/mochitest/test-bug-762593-insecure-passwords-about-blank-web-console-warning.html
rename to devtools/client/webconsole/new-console-output/test/mochitest/test-insecure-passwords-about-blank-web-console-warning.html