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() {
return waitForClipboard(() => {
inspectPage(); // setup: inspect the page
}, DIV_COLOR);
let copied = waitForClipboard(() => {}, DIV_COLOR);
let ready = inspectPage(); // resolves once eyedropper is destroyed
return Promise.all([copied, ready]);
}
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, {}, win);
return dropper.once("destroy");
});
})
}