Bug 1001821 - Wait for eyedropper to be destroyed before ending tests and checking for leaks. r=pbrosset

This commit is contained in:
Sami Jaktholm 2015-01-16 20:49:22 +02:00
parent 4cf65f5879
commit 1f87fff7b8

View File

@ -31,9 +31,10 @@ function spawnTest() {
} }
function inspectAndWaitForCopy() { function inspectAndWaitForCopy() {
return waitForClipboard(() => { let copied = waitForClipboard(() => {}, DIV_COLOR);
inspectPage(); // setup: inspect the page let ready = inspectPage(); // resolves once eyedropper is destroyed
}, DIV_COLOR);
return Promise.all([copied, ready]);
} }
function inspectPage() { function inspectPage() {
@ -54,6 +55,7 @@ function inspectPage() {
EventUtils.synthesizeMouse(target, x + 10, y + 10, { type: "mousemove" }, win); EventUtils.synthesizeMouse(target, x + 10, y + 10, { type: "mousemove" }, win);
EventUtils.synthesizeMouse(target, x + 10, y + 10, {}, win); EventUtils.synthesizeMouse(target, x + 10, y + 10, {}, win);
return dropper.once("destroy");
}); });
}) })
} }