Bug 1401953 - enable browser_webconsole_repeat_different_objects.js;r=nchevobbe
authorJulian Descottes <jdescottes@mozilla.com>
Mon, 08 Jan 2018 21:06:25 +0100
changeset 452703 d9afc5417979939d64843b12458ada9f64445f4f
parent 452702 b446fed39f0fff91c2e55baa2f7d00e39faa2f26
child 452704 b51eda5903d55316bbe4a253c65b91a8433f0701
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe
bugs1401953
milestone59.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 1401953 - enable browser_webconsole_repeat_different_objects.js;r=nchevobbe MozReview-Commit-ID: AVWJGeKrcCe
devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_repeat_different_objects.js
devtools/client/webconsole/new-console-output/test/mochitest/test-repeated-messages.html
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
@@ -361,17 +361,16 @@ skip-if = true #	Bug 1405641
 skip-if = true # Bug 1406841
 #old console skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s
 [browser_webconsole_prune_scroll.js]
 skip-if = true #	Bug 1404832
 [browser_webconsole_reflow.js]
 skip-if = true #	Bug 1406022
 [browser_webconsole_reopen_closed_tab.js]
 [browser_webconsole_repeat_different_objects.js]
-skip-if = true #	Bug 1401953
 [browser_webconsole_repeated_messages_accuracy.js]
 skip-if = true #	Bug 1403450
 [browser_webconsole_sandbox_update_after_navigation.js]
 [browser_webconsole_script_errordoc_urls.js]
 skip-if = true #	Bug 1403454
 # old console skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s
 [browser_webconsole_scroll.js]
 [browser_webconsole_select_all.js]
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_repeat_different_objects.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_repeat_different_objects.js
@@ -4,60 +4,30 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Test that makes sure messages are not considered repeated when console.log()
 // is invoked with different objects, see bug 865288.
 
 "use strict";
 
 const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
-                 "test/test-repeated-messages.html";
+                 "new-console-output/test/mochitest/test-repeated-messages.html";
 
-add_task(function* () {
-  yield loadTab(TEST_URI);
-  let hud = yield openConsole();
-
-  info("waiting for 3 console.log objects");
-
-  hud.jsterm.clearOutput(true);
-  hud.jsterm.execute("window.testConsoleObjects()");
+add_task(async function () {
+  let hud = await openNewTabAndConsole(TEST_URI);
+  hud.jsterm.clearOutput();
 
-  let [result] = yield waitForMessages({
-    webconsole: hud,
-    messages: [{
-      name: "3 console.log messages",
-      text: "abba",
-      category: CATEGORY_WEBDEV,
-      severity: SEVERITY_LOG,
-      count: 3,
-      repeats: 1,
-      objects: true,
-    }],
+  let onMessages = waitForMessages({
+    hud,
+    messages: [
+      { text: "abba" },
+      { text: "abba" },
+      { text: "abba" },
+    ],
   });
 
-  let msgs = [...result.matched];
-  is(msgs.length, 3, "3 message elements");
-
-  for (let i = 0; i < msgs.length; i++) {
-    info("test message element #" + i);
-
-    let msg = msgs[i];
-    let clickable = msg.querySelector(".message-body a");
-    ok(clickable, "clickable object #" + i);
-
-    msg.scrollIntoView(false);
-    yield clickObject(clickable, i);
-  }
+  hud.jsterm.execute("window.testConsoleObjects()");
 
-  function* clickObject(obj, i) {
-    executeSoon(() => {
-      EventUtils.synthesizeMouse(obj, 2, 2, {}, hud.iframeWindow);
-    });
+  info("waiting for 3 console.log objects, with the exact same text content");
+  let messages = await onMessages;
 
-    let varView = yield hud.jsterm.once("variablesview-fetched");
-    ok(varView, "variables view fetched #" + i);
-
-    yield findVariableViewProperties(varView, [
-      { name: "id", value: "abba" + i },
-    ], { webconsole: hud });
-  }
+  is(messages.length, 3, "3 message elements");
 });
-
--- a/devtools/client/webconsole/new-console-output/test/mochitest/test-repeated-messages.html
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/test-repeated-messages.html
@@ -9,17 +9,17 @@
         for(var i = 0; i < 2; i++) {
           console.log("foo repeat");
         }
         console.log("foo repeat");
         console.error("foo repeat");
       }
       function testConsoleObjects() {
         for (var i = 0; i < 3; i++) {
-          var o = { id: "abba" + i };
+          var o = { id: "abba" };
           console.log("abba", o);
         }
       }
       function testConsoleFalsyValues(){
         [NaN, undefined, null].forEach(function(item, index){
           console.log(item);
         });
         [NaN, NaN].forEach(function(item, index){