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 209457 8f49d60bf5c9176c88d6aaf6c985226f8b2e93f6
parent 209456 85318a1536ee23f6c1aa064d7f5e6612f86cce4d
child 209458 33ea2d7e342ece7ea41df93f7e76417ad51d4d77
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [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;