mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Backed out changeset 5a68cb04da53 (bug 1295556) for failing clipboard test browser_computed_search-filter_context-menu.js. r=backout
This commit is contained in:
parent
6b8b80240c
commit
eb615bb8d4
@ -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");
|
||||
|
@ -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 : " +
|
||||
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user