Bug 1055499 - StyleEditor: Properly wait for the toolbox to be destroyed before ending test run and causing windows to leak. r=harth, a=test-only
authorSami Jaktholm <sjakthol@outlook.com>
Wed, 20 Aug 2014 02:02:00 -0400
changeset 208373 8f49d60bf5c9
parent 208372 85318a1536ee
child 208374 33ea2d7e342e
push id3847
push userryanvm@gmail.com
push date2014-08-22 01:00 +0000
treeherdermozilla-beta@8f49d60bf5c9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersharth, test-only
bugs1055499
milestone32.0
Bug 1055499 - StyleEditor: Properly wait for the toolbox to be destroyed before ending test run and causing windows to leak. r=harth, a=test-only
browser/devtools/styleeditor/test/head.js
--- a/browser/devtools/styleeditor/test/head.js
+++ b/browser/devtools/styleeditor/test/head.js
@@ -28,20 +28,23 @@ SimpleTest.registerCleanupFunction(() =>
 
 /**
  * Define an async test based on a generator function
  */
 function asyncTest(generator) {
   return () => Task.spawn(generator).then(null, ok.bind(null, false)).then(finish);
 }
 
-function cleanup()
+function* cleanup()
 {
   gPanelWindow = null;
   while (gBrowser.tabs.length > 1) {
+    let target = TargetFactory.forTab(gBrowser.selectedTab);
+    yield gDevTools.closeToolbox(target);
+
     gBrowser.removeCurrentTab();
   }
 }
 
 function addTabAndOpenStyleEditors(count, callback, uri) {
   let deferred = promise.defer();
   let currentCount = 0;
   let panel;