Fixed a test after the delay loading frame changes
authorRaymond Lee <raymond@raysquare.com>
Tue, 10 Aug 2010 10:31:59 +0800
changeset 50287 12cc701032d31a5bc43279345c1f494ae347d0a9
parent 50286 ce0c948f1554186de653d6cdf6223cdef390e3c3
child 50288 85f4695d1f222c4f50553fe80c07a95b9a907e23
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b4pre
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
Fixed a test after the delay loading frame changes
browser/base/content/test/tabview/browser_tabview_dragdrop.js
--- a/browser/base/content/test/tabview/browser_tabview_dragdrop.js
+++ b/browser/base/content/test/tabview/browser_tabview_dragdrop.js
@@ -34,25 +34,31 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 function test() {
   waitForExplicitFinish();
 
   TabView.toggle();
-  ok(TabView.isVisible(), "Tab View is visible");  
+  window.addEventListener("tabviewshown", onTabViewWindowLoaded, false);
+}
+
+function onTabViewWindowLoaded() {
+  window.removeEventListener("tabviewshown", onTabViewWindowLoaded, false);
+
+  ok(TabView.isVisible(), "Tab View is visible");
   
   let contentWindow = document.getElementById("tab-view").contentWindow;
 
   // create group one and two
   let padding = 10;
   let pageBounds = contentWindow.Items.getPageBounds();
   pageBounds.inset(padding, padding);
-  
+
   let box = new contentWindow.Rect(pageBounds);
   box.width = 300;
   box.height = 300;
 
   let groupOne = new contentWindow.GroupItem([], { bounds: box });
   ok(groupOne.isEmpty(), "This group is empty");
 
   let groupTwo = new contentWindow.GroupItem([], { bounds: box });
@@ -76,17 +82,16 @@ function test() {
     }
   };
   window.addEventListener("tabviewhidden", onTabViewHidden, false);
 
   // open tab in group
   groupOne.newTab("");
 }
 
-
 function addTest(contentWindow, groupOneId, groupTwoId) {
   let groupOne = contentWindow.GroupItems.groupItem(groupOneId);
   let groupTwo = contentWindow.GroupItems.groupItem(groupTwoId);
   let groupOneTabItemCount = groupOne.getChildren().length;
   let groupTwoTabItemCount = groupTwo.getChildren().length;
   is(groupOneTabItemCount, 1, "GroupItem one has a tab"); 
   is(groupTwoTabItemCount, 1, "GroupItem two has two tabs");