Bug 1408937 - enable browser_webconsole_external_script_errors.js;r=bgrins
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 01 Dec 2017 17:59:05 +0100
changeset 706804 45b3e00844a345e7c1e4a55a0dbbdeaff1614f67
parent 706803 51f87fb4c263e28b94dd6334f4a5cd6125c9ff30
child 706805 733552921142a406e7d423ebb3b193d5f44ef4a0
push id91936
push userbmo:emilio@crisal.io
push dateMon, 04 Dec 2017 10:24:39 +0000
reviewersbgrins
bugs1408937
milestone59.0a1
Bug 1408937 - enable browser_webconsole_external_script_errors.js;r=bgrins MozReview-Commit-ID: 4GcSKa2ph4j
devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_external_script_errors.js
devtools/client/webconsole/new-console-output/test/mochitest/test-bug-597136-external-script-errors.html
devtools/client/webconsole/new-console-output/test/mochitest/test-bug-597136-external-script-errors.js
devtools/client/webconsole/new-console-output/test/mochitest/test-external-script-errors.html
devtools/client/webconsole/new-console-output/test/mochitest/test-external-script-errors.js
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
@@ -44,18 +44,16 @@ support-files =
   test-bug-595934-image.jpg
   test-bug-595934-imagemap.html
   test-bug-595934-malformedxml-external.html
   test-bug-595934-malformedxml-external.xml
   test-bug-595934-malformedxml.xhtml
   test-bug-595934-svg.xhtml
   test-bug-595934-workers.html
   test-bug-595934-workers.js
-  test-bug-597136-external-script-errors.html
-  test-bug-597136-external-script-errors.js
   test-bug-599725-response-headers.sjs
   test-bug-601177-log-levels.html
   test-bug-601177-log-levels.js
   test-bug-603750-websocket.html
   test-bug-603750-websocket.js
   test-cd-iframe-child.html
   test-cd-iframe-parent.html
   test-console-api-iframe.html
@@ -116,16 +114,18 @@ support-files =
   test-cu-reporterror.js
   test-data.json
   test-data.json^headers^
   test-duplicate-error.html
   test-encoding-ISO-8859-1.html
   test-error.html
   test-eval-in-stackframe.html
   test-exception-stackframe.html
+  test-external-script-errors.html
+  test-external-script-errors.js
   test-file-location.js
   test-filter.html
   test-for-of.html
   test-iframe-762593-insecure-form-action.html
   test-iframe-762593-insecure-frame.html
   test-iframe1.html
   test-iframe2.html
   test-iframe3.html
@@ -276,17 +276,16 @@ skip-if = true #	Bug 1403907
 [browser_webconsole_errors_after_page_reload.js]
 skip-if = true # Bug 1408935
 [browser_webconsole_eval_in_debugger_stackframe.js]
 [browser_webconsole_eval_in_debugger_stackframe2.js]
 skip-if = true # Bug 1408893
 [browser_webconsole_execution_scope.js]
 skip-if = true #	Bug 1405333
 [browser_webconsole_external_script_errors.js]
-skip-if = true # Bug 1408937
 [browser_webconsole_file_uri.js]
 skip-if = true #	Bug 1404382
 [browser_webconsole_filter_scroll.js]
 skip-if = true #	Bug 1404392
 [browser_webconsole_filters.js]
 [browser_webconsole_filters_persist.js]
 [browser_webconsole_highlighter_console_helper.js]
 skip-if = true #	Bug 1404853
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_external_script_errors.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_external_script_errors.js
@@ -2,34 +2,26 @@
 /* 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/ */
 
 "use strict";
 
 // See Bug 597136.
 
-const TEST_URI = "http://example.com/browser/devtools/client/" +
-                 "webconsole/test/test-bug-597136-external-script-" +
-                 "errors.html";
-
-function test() {
-  Task.spawn(function* () {
-    const {tab} = yield loadTab(TEST_URI);
-    const hud = yield openConsole(tab);
+const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
+                 "new-console-output/test/mochitest/test-external-script-errors.html";
 
-    // On e10s, the exception is triggered in child process
-    // and is ignored by test harness
-    if (!Services.appinfo.browserTabsRemoteAutostart) {
-      expectUncaughtException();
-    }
-    BrowserTestUtils.synthesizeMouseAtCenter("button", {}, gBrowser.selectedBrowser);
+add_task(async function () {
+  // On e10s, the exception is triggered in child process
+  // and is ignored by test harness
+  if (!Services.appinfo.browserTabsRemoteAutostart) {
+    expectUncaughtException();
+  }
 
-    yield waitForMessages({
-      webconsole: hud,
-      messages: [{
-        text: "bogus is not defined",
-        category: CATEGORY_JS,
-        severity: SEVERITY_ERROR,
-      }],
-    });
-  }).then(finishTest);
-}
+  let hud = await openNewTabAndConsole(TEST_URI);
+
+  let onMessage = waitForMessage(hud, "bogus is not defined");
+  BrowserTestUtils.synthesizeMouseAtCenter("button", {}, gBrowser.selectedBrowser);
+  await onMessage;
+
+  ok(true, "Received the expected message");
+});
rename from devtools/client/webconsole/new-console-output/test/mochitest/test-bug-597136-external-script-errors.html
rename to devtools/client/webconsole/new-console-output/test/mochitest/test-external-script-errors.html
--- a/devtools/client/webconsole/new-console-output/test/mochitest/test-bug-597136-external-script-errors.html
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/test-external-script-errors.html
@@ -14,12 +14,12 @@
   -->
     <title>Test for bug 597136: external script errors</title>
   </head>
   <body>
     <h1>Test for bug 597136: external script errors</h1>
     <p><button onclick="f()">Click me</button</p>
 
     <script type="text/javascript"
-      src="test-bug-597136-external-script-errors.js"></script>
+      src="test-external-script-errors.js"></script>
   </body>
 </html>
 
rename from devtools/client/webconsole/new-console-output/test/mochitest/test-bug-597136-external-script-errors.js
rename to devtools/client/webconsole/new-console-output/test/mochitest/test-external-script-errors.js