Bug 1191216 - Part 1: Intermittent browser_console_error_source_click.js - fix test. r=bgrins, a=test-only
authorJarda Snajdr <jsnajdr@gmail.com>
Mon, 27 Jun 2016 04:48:00 +0200
changeset 342342 381f8e4d3af575e9be1e1cc64ca49966c10c1c49
parent 342341 de9b85d4fe6b4da28df7fb0e1765d9a5558e6e07
child 342343 6b92442b0d5c497e26a0f80a7a717edd410293d5
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins, test-only
bugs1191216
milestone49.0
Bug 1191216 - Part 1: Intermittent browser_console_error_source_click.js - fix test. r=bgrins, a=test-only
devtools/client/webconsole/test/browser_console_error_source_click.js
--- a/devtools/client/webconsole/test/browser_console_error_source_click.js
+++ b/devtools/client/webconsole/test/browser_console_error_source_click.js
@@ -9,20 +9,26 @@
 "use strict";
 
 const TEST_URI = "data:text/html;charset=utf8,<p>hello world from bug 877778 " +
                  "<button onclick='foobar.explode()' " +
                  "style='test-color: green-please'>click!</button>";
 function test() {
   let hud;
 
-  loadTab(TEST_URI).then(() => {
-    HUDService.toggleBrowserConsole().then(browserConsoleOpened);
+  let prefsPushed = new Promise(resolve => {
+    SpecialPowers.pushPrefEnv({"set": [
+      ["devtools.browserconsole.filter.cssparser", true]
+    ]}, resolve);
   });
 
+  prefsPushed.then(() => loadTab(TEST_URI))
+             .then(() => HUDService.toggleBrowserConsole())
+             .then(browserConsoleOpened);
+
   function browserConsoleOpened(hudConsole) {
     hud = hudConsole;
     ok(hud, "browser console opened");
 
     // On e10s, the exception is triggered in child process
     // and is ignored by test harness
     if (!Services.appinfo.browserTabsRemoteAutostart) {
       expectUncaughtException();
@@ -49,30 +55,33 @@ function test() {
         },
       ],
     }).then(onMessageFound);
   }
 
   function onMessageFound(results) {
     let viewSource = hud.viewSource;
     let viewSourceCalled = false;
-    hud.viewSourceInDebugger = () => {
+
+    hud.viewSource = () => {
       viewSourceCalled = true;
     };
 
     for (let result of results) {
       viewSourceCalled = false;
 
-      let msg = [...results[0].matched][0];
+      let msg = [...result.matched][0];
       ok(msg, "message element found for: " + result.text);
-      let selector = ".message > .message-location .frame-link-filename";
+      ok(!msg.classList.contains("filtered-by-type"), "message element is not filtered");
+      let selector = ".message > .message-location .frame-link-source";
       let locationNode = msg.querySelector(selector);
       ok(locationNode, "message location element found");
 
       EventUtils.synthesizeMouse(locationNode, 2, 2, {}, hud.iframeWindow);
 
       ok(viewSourceCalled, "view source opened");
     }
 
-    hud.viewSourceInDebugger = viewSource;
+    hud.viewSource = viewSource;
+
     finishTest();
   }
 }