From 9590ffee645ae045d90e1074b85f3cf66158f26e Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Thu, 23 Nov 2017 18:20:19 +0100 Subject: [PATCH] Bug 1408943 - enable browser_webconsole_network_exceptions.js;r=nchevobbe MozReview-Commit-ID: 7Jb2y9AQ4fa --HG-- rename : devtools/client/webconsole/new-console-output/test/mochitest/test-bug-618078-network-exceptions.html => devtools/client/webconsole/new-console-output/test/mochitest/test-network-exceptions.html extra : rebase_source : 6b330a24197ea058a91271ea1d36baa2436b1937 --- .../test/mochitest/browser.ini | 3 +-- .../browser_webconsole_network_exceptions.js | 23 +++++++------------ ...ions.html => test-network-exceptions.html} | 0 3 files changed, 9 insertions(+), 17 deletions(-) rename devtools/client/webconsole/new-console-output/test/mochitest/{test-bug-618078-network-exceptions.html => test-network-exceptions.html} (100%) diff --git a/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini b/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini index c330cb4cccb0..9ce2fa0077b3 100644 --- a/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini +++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini @@ -62,7 +62,6 @@ support-files = test-cd-iframe-child.html test-cd-iframe-parent.html test-console-api-iframe.html - test-bug-618078-network-exceptions.html test-bug-630733-response-redirect-headers.sjs test-bug-632275-getters.html test-bug-632347-iterators-generators.html @@ -145,6 +144,7 @@ support-files = test-location-styleeditor-link.html test-mixedcontent-securityerrors.html test-mutation.html + test-network-exceptions.html test-network-request.html test-network.html test-observe-http-ajax.html @@ -353,7 +353,6 @@ skip-if = true # Bug 1408942 skip-if = true # Bug 1405636 [browser_webconsole_network_attach.js] [browser_webconsole_network_exceptions.js] -skip-if = true # Bug 1408943 [browser_webconsole_network_messages_expand.js] [browser_webconsole_network_messages_openinnet.js] [browser_webconsole_network_requests_from_chrome.js] diff --git a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_network_exceptions.js b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_network_exceptions.js index 439793b22308..6fa1e3933e0d 100644 --- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_network_exceptions.js +++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_network_exceptions.js @@ -10,12 +10,10 @@ const TEST_URI = "data:text/html;charset=utf-8,Web Console test for bug 618078"; const TEST_URI2 = "http://example.com/browser/devtools/client/webconsole/" + - "test/test-bug-618078-network-exceptions.html"; + "new-console-output/test/mochitest/test-network-exceptions.html"; -add_task(function* () { - yield loadTab(TEST_URI); - - let hud = yield openConsole(); +add_task(async function () { + let hud = await openNewTabAndConsole(TEST_URI); // On e10s, the exception is triggered in child process // and is ignored by test harness @@ -23,14 +21,9 @@ add_task(function* () { expectUncaughtException(); } - BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_URI2); - - yield waitForMessages({ - webconsole: hud, - messages: [{ - text: "bug618078exception", - category: CATEGORY_JS, - severity: SEVERITY_ERROR, - }], - }); + let onMessage = waitForMessage(hud, "bug618078exception"); + await loadDocument(TEST_URI2); + let { node } = await onMessage; + ok(true, "Network exception logged as expected."); + ok(node.classList.contains("error"), "Network exception is logged as error."); }); diff --git a/devtools/client/webconsole/new-console-output/test/mochitest/test-bug-618078-network-exceptions.html b/devtools/client/webconsole/new-console-output/test/mochitest/test-network-exceptions.html similarity index 100% rename from devtools/client/webconsole/new-console-output/test/mochitest/test-bug-618078-network-exceptions.html rename to devtools/client/webconsole/new-console-output/test/mochitest/test-network-exceptions.html