Bug 1408937 - enable browser_webconsole_external_script_errors.js;r=bgrins
MozReview-Commit-ID: 4GcSKa2ph4j
--- 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
@@ -277,17 +277,16 @@ skip-if = true # Bug 1403907
skip-if = true # Bug 1408935
[browser_webconsole_eval_in_debugger_stackframe.js]
skip-if = true # Bug 1408936
[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