Backed out changeset 5a68cb04da53 (bug 1295556) for failing clipboard test browser_computed_search-filter_context-menu.js. r=backout

This commit is contained in:
Sebastian Hengst 2016-09-12 17:48:44 +02:00
parent 6b8b80240c
commit eb615bb8d4
5 changed files with 21 additions and 4 deletions

View File

@ -23,7 +23,7 @@ add_task(function* () {
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");

View File

@ -34,7 +34,7 @@ function* setSelectionNodeFront(node, inspector) {
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 : " +

View File

@ -44,6 +44,6 @@ add_task(function* () {
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);
}
});

View File

@ -50,7 +50,7 @@ add_task(function* () {
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;

View File

@ -618,6 +618,23 @@ function waitForStyleEditor(toolbox, href) {
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