Bug 1001821 - Wait for eyedropper to be destroyed before ending tests and checking for leaks. r=pbrosset
authorSami Jaktholm <sjakthol@outlook.com>
Fri, 16 Jan 2015 20:49:22 +0200
changeset 253771 3ca92178aac791e5823f9a6ed57a864733b23c27
parent 253770 9ea84a34c51842017bbf6e68dfccbcf3dcd50a9a
child 253772 4fafebcfc9df3488bfbd22a7b31d2cf263eb0b83
push id721
push userjlund@mozilla.com
push dateTue, 21 Apr 2015 23:03:33 +0000
treeherdermozilla-release@d27c9211ebb3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbrosset
bugs1001821
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1001821 - Wait for eyedropper to be destroyed before ending tests and checking for leaks. r=pbrosset
browser/devtools/eyedropper/test/browser_eyedropper_cmd.js
--- a/browser/devtools/eyedropper/test/browser_eyedropper_cmd.js
+++ b/browser/devtools/eyedropper/test/browser_eyedropper_cmd.js
@@ -26,19 +26,20 @@ function spawnTest() {
 
   yield inspectAndWaitForCopy();
 
   yield helpers.closeToolbar(options);
   yield helpers.closeTab(options);
 }
 
 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() {
   let target = document.documentElement;
   let win = window;
 
   // get location of the <div> in the content, offset from browser window
   let box = gBrowser.selectedBrowser.getBoundingClientRect();
@@ -49,11 +50,12 @@ function inspectPage() {
 
   return dropperStarted(dropper).then(() => {
     EventUtils.synthesizeMouse(target, x, y, { type: "mousemove" }, win);
 
     return dropperLoaded(dropper).then(() => {
       EventUtils.synthesizeMouse(target, x + 10, y + 10, { type: "mousemove" }, win);
 
       EventUtils.synthesizeMouse(target, x + 10, y + 10, {}, win);
+      return dropper.once("destroy");
     });
   })
 }