Bug 1403449 - Enable browser_webconsole_console_dir_uninspectable.js in new frontend; r=jdescottes.
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Tue, 07 Nov 2017 09:35:06 +0100
changeset 443816 888caf45e5efb1d4cb7c816e7d61e5895a02c13e
parent 443815 deaf42e9dbecacba453afa921cad45f3dfeebc6c
child 443817 059f6f6a4ef55c40674ece3d1da45702a0811a47
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1403449
milestone58.0a1
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
Bug 1403449 - Enable browser_webconsole_console_dir_uninspectable.js in new frontend; r=jdescottes. MozReview-Commit-ID: 5d0vbbVKi2T
devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_console_dir_uninspectable.js
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
@@ -249,17 +249,16 @@ skip-if = true # Bug 1408928
 [browser_webconsole_closure_inspection.js]
 skip-if = true #	Bug 1405250
 [browser_webconsole_completion.js]
 skip-if = true # Bug 1408929
 [browser_webconsole_console_api_iframe.js]
 skip-if = true # Bug 1408930
 [browser_webconsole_console_dir.js]
 [browser_webconsole_console_dir_uninspectable.js]
-skip-if = true #	Bug 1403449
 [browser_webconsole_console_group.js]
 [browser_webconsole_console_logging_workers_api.js]
 skip-if = true # Bug 1405252
 [browser_webconsole_console_table.js]
 [browser_webconsole_context_menu_copy_entire_message.js]
 subsuite = clipboard
 skip-if = (os == 'linux' && bits == 32 && debug) # bug 1328915, disable linux32 debug devtools for timeouts
 [browser_webconsole_context_menu_copy_link_location.js]
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_console_dir_uninspectable.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_console_dir_uninspectable.js
@@ -3,45 +3,36 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Make sure that the Web Console output does not break after we try to call
 // console.dir() for objects that are not inspectable.
 
 "use strict";
 
-const TEST_URI = "data:text/html;charset=utf8,test for bug 773466";
-
-add_task(function* () {
-  yield loadTab(TEST_URI);
+const TEST_URI = "data:text/html;charset=utf8,test console.dir on uninspectable object";
+const FIRST_LOG_MESSAGE = "fooBug773466a";
+const SECOND_LOG_MESSAGE = "fooBug773466b";
 
-  let hud = yield openConsole();
-
-  hud.jsterm.clearOutput(true);
+add_task(async function () {
+  const hud = await openNewTabAndConsole(TEST_URI);
+  const {jsterm} = hud;
 
-  hud.jsterm.execute("console.log('fooBug773466a')");
-  hud.jsterm.execute("myObj = Object.create(null)");
-  hud.jsterm.execute("console.dir(myObj)");
+  info("Logging a first message to make sure everything is working");
+  let onLogMessage = waitForMessage(hud, FIRST_LOG_MESSAGE);
+  jsterm.execute(`console.log("${FIRST_LOG_MESSAGE}")`);
+  await onLogMessage;
 
-  yield waitForMessages({
-    webconsole: hud,
-    messages: [{
-      text: "fooBug773466a",
-      category: CATEGORY_WEBDEV,
-      severity: SEVERITY_LOG,
-    },
-    {
-      name: "console.dir output",
-      consoleDir: "[object Object]",
-    }],
+  info("console.dir on an uninspectable object");
+  const onDirMessage = waitForMessage(hud, "Object {  }");
+  jsterm.execute("console.dir(Object.create(null))");
+  await onDirMessage;
+
+  info("Logging a second message to make sure the console is not broken");
+  onLogMessage = waitForMessage(hud, SECOND_LOG_MESSAGE);
+  // Logging from content to make sure the console API is working.
+  ContentTask.spawn(gBrowser.selectedBrowser, SECOND_LOG_MESSAGE, (string) => {
+    content.console.log(string);
   });
-
-  content.console.log("fooBug773466b");
+  await onLogMessage;
 
-  yield waitForMessages({
-    webconsole: hud,
-    messages: [{
-      text: "fooBug773466b",
-      category: CATEGORY_WEBDEV,
-      severity: SEVERITY_LOG,
-    }],
-  });
+  ok(true, "The console.dir call on an uninspectable object did not break the console");
 });