Bug 1273369 - Remove CPOW usage in browser_webconsole_bug_613280_jsterm_copy.js. r=bgrins, a=test-only
authorKevin Chan <kevchan85@yahoo.com>
Fri, 09 Sep 2016 07:48:56 -0700
changeset 350197 15daa0afa249e4a98ea85d03402aa09cf5eae20c
parent 350196 dd74105957e26e3134fd6306473d7303cd6b0165
child 350198 201882b9e76226bc970f38abd2d99a0e231669a4
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins, test-only
bugs1273369
milestone50.0a2
Bug 1273369 - Remove CPOW usage in browser_webconsole_bug_613280_jsterm_copy.js. r=bgrins, a=test-only MozReview-Commit-ID: 8fYEOrIZF72
devtools/client/webconsole/test/browser_webconsole_bug_613280_jsterm_copy.js
--- a/devtools/client/webconsole/test/browser_webconsole_bug_613280_jsterm_copy.js
+++ b/devtools/client/webconsole/test/browser_webconsole_bug_613280_jsterm_copy.js
@@ -5,61 +5,43 @@
 
 "use strict";
 
 const TEST_URI = "data:text/html;charset=utf-8,Web Console test for bug 613280";
 
 function test() {
   loadTab(TEST_URI).then(() => {
     openConsole().then((HUD) => {
-      content.console.log("foobarBazBug613280");
+      ContentTask.spawn(gBrowser.selectedBrowser, null, function*(){
+        content.console.log("foobarBazBug613280");
+      });
       waitForMessages({
         webconsole: HUD,
         messages: [{
           text: "foobarBazBug613280",
           category: CATEGORY_WEBDEV,
           severity: SEVERITY_LOG,
         }],
       }).then(performTest.bind(null, HUD));
     });
   });
 }
 
 function performTest(HUD, [result]) {
   let msg = [...result.matched][0];
   let input = HUD.jsterm.inputNode;
-  let selection = getSelection();
-  let contentSelection = content.getSelection();
 
   let clipboardSetup = function () {
     goDoCommand("cmd_copy");
   };
 
   let clipboardCopyDone = function () {
     finishTest();
   };
 
-  // Check if we first need to clear any existing selections.
-  if (selection.rangeCount > 0 || contentSelection.rangeCount > 0 ||
-      input.selectionStart != input.selectionEnd) {
-    if (input.selectionStart != input.selectionEnd) {
-      input.selectionStart = input.selectionEnd = 0;
-    }
-
-    if (selection.rangeCount > 0) {
-      selection.removeAllRanges();
-    }
-
-    if (contentSelection.rangeCount > 0) {
-      contentSelection.removeAllRanges();
-    }
-
-    goUpdateCommand("cmd_copy");
-  }
-
   let controller = top.document.commandDispatcher
                                .getControllerForCommand("cmd_copy");
   is(controller.isCommandEnabled("cmd_copy"), false, "cmd_copy is disabled");
 
   HUD.ui.output.selectMessage(msg);
   HUD.outputNode.focus();
 
   goUpdateCommand("cmd_copy");