Bug 1239566 - Get rid of CPOW in browser_webconsole_view_source.js;r=linclark draft
authorBrian Grinstead <bgrinstead@mozilla.com>
Wed, 13 Apr 2016 07:04:26 -0700
changeset 350366 58fee5cc42a2c289bb46a470b148bbb02da69709
parent 350334 ea707a9243907d2e89337d01ecf7c66f5f543a86
child 518315 80e0626b01a208867b859cdbf10e55ae703d1956
push id15321
push userbgrinstead@mozilla.com
push dateWed, 13 Apr 2016 14:04:58 +0000
reviewerslinclark
bugs1239566
milestone48.0a1
Bug 1239566 - Get rid of CPOW in browser_webconsole_view_source.js;r=linclark MozReview-Commit-ID: EQNXg7M9dZr
devtools/client/webconsole/test/browser_webconsole_view_source.js
--- a/devtools/client/webconsole/test/browser_webconsole_view_source.js
+++ b/devtools/client/webconsole/test/browser_webconsole_view_source.js
@@ -11,25 +11,28 @@
 const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
                  "test/test-error.html";
 
 add_task(function*() {
   yield loadTab(TEST_URI);
   let hud = yield openConsole(null);
   info("console opened");
 
-  let button = content.document.querySelector("button");
-  ok(button, "we have the button on the page");
 
   // On e10s, the exception is triggered in child process
   // and is ignored by test harness
   if (!Services.appinfo.browserTabsRemoteAutostart) {
     expectUncaughtException();
   }
-  EventUtils.sendMouseEvent({ type: "click" }, button, content);
+
+  ContentTask.spawn(gBrowser.selectedBrowser, {}, function*() {
+    let button = content.document.querySelector("button");
+    ok(button, "we have the button on the page");
+    button.click();
+  });
 
   let [result] = yield waitForMessages({
     webconsole: hud,
     messages: [{
       text: "fooBazBaz is not defined",
       category: CATEGORY_JS,
       severity: SEVERITY_ERROR,
     }],