Backed out changeset 5a68cb04da53 (bug 1295556) for failing clipboard test browser_computed_search-filter_context-menu.js. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Mon, 12 Sep 2016 17:48:44 +0200
changeset 339256 c4f263eaa467e03eb1b524e3d5e00b3411777418
parent 339255 082c1bcd6035e3475412dc26809b18b2c8300817
child 339257 c1a0f3b91b283afbb8d73fd692af7f591c4f1d81
push id10033
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:50:26 +0000
treeherdermozilla-aurora@5dddbefdf759 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1295556
milestone51.0a1
backs out5a68cb04da5303c5c1e4b855af851ca5f608f9a3
Backed out changeset 5a68cb04da53 (bug 1295556) for failing clipboard test browser_computed_search-filter_context-menu.js. r=backout
devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-clipboard.js
devtools/client/inspector/test/browser_inspector_keyboard-shortcuts-copy-outerhtml.js
devtools/client/inspector/test/browser_inspector_menu-02-copy-items.js
devtools/client/inspector/test/browser_inspector_search-filter_context-menu.js
devtools/client/inspector/test/head.js
--- a/devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-clipboard.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-clipboard.js
@@ -18,17 +18,17 @@ add_task(function* () {
        waitForElementAttributeSet, waitForElementAttributeRemoved} = helper;
 
   info("Show the eyedropper with the copyOnSelect option");
   yield show("html", {copyOnSelect: true});
 
   info("Make sure to wait until the eyedropper is done taking a screenshot of the page");
   yield waitForElementAttributeSet("root", "drawn", helper);
 
-  yield waitForClipboardPromise(() => {
+  yield waitForClipboard(() => {
     info("Activate the eyedropper so the background color is copied");
     EventUtils.synthesizeKey("VK_RETURN", {});
   }, "#FF0000");
 
   ok(true, "The clipboard contains the right value");
 
   yield waitForElementAttributeRemoved("root", "drawn", helper);
   yield waitForElementAttributeSet("root", "hidden", helper);
--- a/devtools/client/inspector/test/browser_inspector_keyboard-shortcuts-copy-outerhtml.js
+++ b/devtools/client/inspector/test/browser_inspector_keyboard-shortcuts-copy-outerhtml.js
@@ -29,17 +29,17 @@ add_task(function* () {
 function* setSelectionNodeFront(node, inspector) {
   let updated = inspector.once("inspector-updated");
   inspector.selection.setNodeFront(node);
   yield updated;
 }
 
 function* checkClipboard(expectedText, node) {
   try {
-    yield waitForClipboardPromise(() => fireCopyEvent(node), expectedText);
+    yield waitForClipboard(() => fireCopyEvent(node), expectedText);
     ok(true, "Clipboard successfully filled with : " + expectedText);
   } catch (e) {
     ok(false, "Clipboard could not be filled with the expected text : " +
               expectedText);
   }
 }
 
 function getElementByType(inspector, type) {
--- a/devtools/client/inspector/test/browser_inspector_menu-02-copy-items.js
+++ b/devtools/client/inspector/test/browser_inspector_menu-02-copy-items.js
@@ -39,11 +39,11 @@ add_task(function* () {
   for (let {desc, id, selector, text} of COPY_ITEMS_TEST_DATA) {
     info("Testing " + desc);
     yield selectNode(selector, inspector);
 
     let allMenuItems = openContextMenuAndGetAllItems(inspector);
     let item = allMenuItems.find(i => i.id === id);
     ok(item, "The popup has a " + desc + " menu item.");
 
-    yield waitForClipboardPromise(() => item.click(), text);
+    yield waitForClipboard(() => item.click(), text);
   }
 });
--- a/devtools/client/inspector/test/browser_inspector_search-filter_context-menu.js
+++ b/devtools/client/inspector/test/browser_inspector_search-filter_context-menu.js
@@ -45,17 +45,17 @@ add_task(function* () {
   yield onContextMenuHidden;
 
   info("Copy text in search field using the context menu");
   searchBox.value = TEST_INPUT;
   searchBox.select();
   EventUtils.synthesizeMouse(searchBox, 2, 2,
     {type: "contextmenu", button: 2}, win);
   yield onContextMenuPopup;
-  yield waitForClipboardPromise(() => cmdCopy.click(), TEST_INPUT);
+  yield waitForClipboard(() => cmdCopy.click(), TEST_INPUT);
   searchContextMenu.hidePopup();
   yield onContextMenuHidden;
 
   info("Reopen context menu and check command properties");
   EventUtils.synthesizeMouse(searchBox, 2, 2,
     {type: "contextmenu", button: 2}, win);
   yield onContextMenuPopup;
 
--- a/devtools/client/inspector/test/head.js
+++ b/devtools/client/inspector/test/head.js
@@ -614,16 +614,33 @@ function waitForStyleEditor(toolbox, hre
       panel.UI.on("editor-selected", gotEditor);
     }
   });
 
   return def.promise;
 }
 
 /**
+ * @see SimpleTest.waitForClipboard
+ *
+ * @param {Function} setup
+ *        Function to execute before checking for the
+ *        clipboard content
+ * @param {String|Function} expected
+ *        An expected string or validator function
+ * @return a promise that resolves when the expected string has been found or
+ * the validator function has returned true, rejects otherwise.
+ */
+function waitForClipboard(setup, expected) {
+  let def = defer();
+  SimpleTest.waitForClipboard(expected, setup, def.resolve, def.reject);
+  return def.promise;
+}
+
+/**
  * Checks if document's active element is within the given element.
  * @param  {HTMLDocument}  doc document with active element in question
  * @param  {DOMNode}       container element tested on focus containment
  * @return {Boolean}
  */
 function containsFocus(doc, container) {
   let elm = doc.activeElement;
   while (elm) {