Bug 628620 - intermittent timeout in content/test/tabview/browser_tabview_bug606657.js [r=ian, a=test]
authorTim Taubert <tim.taubert@gmx.de>
Wed, 26 Jan 2011 22:24:12 +0100
changeset 61547 cfd957a4ac9f9d8a07083f94b326ca2b18fd9472
parent 61546 21f96c423923858a0796954ae1075c1b133777a2
child 61548 e2f9d9c8b18ca0a3ff3909db12417729b2c01124
push idunknown
push userunknown
push dateunknown
reviewersian, test
bugs628620, 606657
milestone2.0b11pre
Bug 628620 - intermittent timeout in content/test/tabview/browser_tabview_bug606657.js [r=ian, a=test]
browser/base/content/test/tabview/browser_tabview_bug606657.js
--- a/browser/base/content/test/tabview/browser_tabview_bug606657.js
+++ b/browser/base/content/test/tabview/browser_tabview_bug606657.js
@@ -33,33 +33,18 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   waitForExplicitFinish();
 
-  window.addEventListener('tabviewshown', onTabViewWindowLoaded, false);
-  TabView.toggle();
-}
-
-function onTabViewWindowLoaded() {
-  window.removeEventListener('tabviewshown', onTabViewWindowLoaded, false);
-
-  let [tab] = gBrowser.tabs;
-  let groupId = tab._tabViewTabItem.parent.id;
+  showTabView(function () {
+    let [tab] = gBrowser.tabs;
+    let groupId = tab._tabViewTabItem.parent.id;
 
-  let finishTest = function () {
-    let onTabViewHidden = function () {
-      window.removeEventListener('tabviewhidden', onTabViewHidden, false);
-      finish();
-    }
+    TabView.moveTabTo(tab, groupId);
+    is(tab._tabViewTabItem.parent.id, groupId, 'tab did not change its group');
 
-    window.addEventListener('tabviewhidden', onTabViewHidden, false);
-    TabView.hide();
-  }
-
-  TabView.moveTabTo(tab, groupId);
-  is(tab._tabViewTabItem.parent.id, groupId, 'tab did not change its group');
-
-  finishTest();
+    hideTabView(finish);
+  });
 }