Bug 1535725 - Change test-session-store.js to use clientWidth/Height; rs=bustage-fix
authorGeoff Lankow <geoff@darktrojan.net>
Thu, 18 Apr 2019 12:37:52 +1200
changeset 26380 1e9b60bd5e340a500fe97f5618d948dcdeed40b6
parent 26379 564deb03842feb687a6234d09ad032e73f207054
child 26381 899c32fe465cadbb3a7bad16ecb41ebe52df987d
push id15810
push usergeoff@darktrojan.net
push dateThu, 18 Apr 2019 00:38:25 +0000
treeherdercomm-central@1e9b60bd5e34 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage-fix
bugs1535725
Bug 1535725 - Change test-session-store.js to use clientWidth/Height; rs=bustage-fix
mail/test/mozmill/session-store/test-session-store.js
--- a/mail/test/mozmill/session-store/test-session-store.js
+++ b/mail/test/mozmill/session-store/test-session-store.js
@@ -199,30 +199,30 @@ function test_message_pane_height_persis
   be_in_folder(folderA);
   assert_message_pane_visible();
   assert_pane_layout(kClassicMailLayout);
 
   // Get the state object. This assumes there is one and only one
   // 3pane window.
   let mail3PaneWindow = Services.wm.getMostRecentWindow("mail:3pane");
 
-  let oldHeight = mc.e("messagepaneboxwrapper").getBoundingClientRect().height;
+  let oldHeight = mc.e("messagepaneboxwrapper").clientHeight;
   let minHeight = Math.floor(mc.e("messagepaneboxwrapper").getAttribute("minheight"));
   let newHeight = Math.floor((minHeight + oldHeight) / 2);
   let diffHeight = oldHeight - newHeight;
 
   assert_not_equals(oldHeight, newHeight,
     "To really perform a test the new message pane height should be " +
     "should be different from the old one but they are the same: " +
     newHeight);
 
   _move_splitter(mc.e("threadpane-splitter"), 0, diffHeight);
 
   // Check that the moving of the threadpane-splitter resulted in the correct height.
-  let actualHeight = mc.e("messagepaneboxwrapper").getBoundingClientRect().height;
+  let actualHeight = mc.e("messagepaneboxwrapper").clientHeight;
 
   assert_equals(newHeight, actualHeight,
     "The message pane height should be " + newHeight + ", but is actually " +
     actualHeight + ". The oldHeight was: " + oldHeight);
 
   // Make sure we have a different window open, so that we don't start shutting
   // down just because the last window was closed.
   let abwc = openAddressBook();
@@ -231,17 +231,17 @@ function test_message_pane_height_persis
   close_window(new mozmill.controller.MozMillController(mail3PaneWindow));
   // Wait for window close async session write to finish.
   controller.sleep(asyncFileWriteDelayMS);
 
   mc = open3PaneWindow();
   be_in_folder(folderA);
   assert_message_pane_visible();
 
-  actualHeight = mc.e("messagepaneboxwrapper").getBoundingClientRect().height;
+  actualHeight = mc.e("messagepaneboxwrapper").clientHeight;
 
   assert_equals(newHeight, actualHeight,
     "The message pane height should be " + newHeight + ", but is actually " +
     actualHeight + ". The oldHeight was: " + oldHeight);
 
   // The old height is restored.
   _move_splitter(mc.e("threadpane-splitter"), 0, -diffHeight);
 
@@ -249,17 +249,17 @@ function test_message_pane_height_persis
   close_window(mc);
   // Wait for window close async session write to finish.
   controller.sleep(asyncFileWriteDelayMS);
 
   mc = open3PaneWindow();
   be_in_folder(folderA);
   assert_message_pane_visible();
 
-  actualHeight = mc.e("messagepaneboxwrapper").getBoundingClientRect().height;
+  actualHeight = mc.e("messagepaneboxwrapper").clientHeight;
   assert_equals(oldHeight, actualHeight,
     "The message pane height should be " + oldHeight + ", but is actually " +
     actualHeight);
 
   // We don't need the address book window any more.
   plan_for_window_close(abwc);
   abwc.window.close();
   wait_for_window_close();
@@ -274,30 +274,30 @@ function test_message_pane_width_persist
   assert_pane_layout(kClassicMailLayout);
   set_pane_layout(kVerticalMailLayout);
   assert_pane_layout(kVerticalMailLayout);
 
   // Get the state object. This assumes there is one and only one
   // 3pane window.
   let mail3PaneWindow = Services.wm.getMostRecentWindow("mail:3pane");
 
-  let oldWidth = mc.e("messagepaneboxwrapper").getBoundingClientRect().width;
+  let oldWidth = mc.e("messagepaneboxwrapper").clientWidth;
   let minWidth = Math.floor(mc.e("messagepaneboxwrapper").getAttribute("minwidth"));
   let newWidth = Math.floor((minWidth + oldWidth) / 2);
   let diffWidth = oldWidth - newWidth;
 
   assert_not_equals(newWidth, oldWidth,
     "To really perform a test the new message pane width should be " +
     "should be different from the old one but they are the same: " + newWidth);
 
   // We move the threadpane-splitter and not the folderpane_splitter because
   // we are in vertical layout.
   _move_splitter(mc.e("threadpane-splitter"), diffWidth, 0);
   // Check that the moving of the folderpane_splitter resulted in the correct width.
-  let actualWidth = mc.e("messagepaneboxwrapper").getBoundingClientRect().width;
+  let actualWidth = mc.e("messagepaneboxwrapper").clientWidth;
 
   // FIXME: For whatever reasons the new width is off by one pixel on Mac OSX
   // But this test case is not for testing moving around a splitter but for
   // persistency. Therefore it is enough if the actual width is equal to the
   // the requested width plus/minus one pixel.
   assert_equals_fuzzy(newWidth, actualWidth, 1,
     "The message pane width should be " + newWidth + ", but is actually " +
     actualWidth + ". The oldWidth was: " + oldWidth);
@@ -312,23 +312,23 @@ function test_message_pane_width_persist
   // Wait for window close async session write to finish.
   controller.sleep(asyncFileWriteDelayMS);
 
   mc = open3PaneWindow();
   be_in_folder(folderA);
   assert_message_pane_visible();
   assert_pane_layout(kVerticalMailLayout);
 
-  actualWidth = mc.e("messagepaneboxwrapper").getBoundingClientRect().width;
+  actualWidth = mc.e("messagepaneboxwrapper").clientWidth;
   assert_equals(newWidth, actualWidth, "The message pane width should be " +
     newWidth + ", but is actually " + actualWidth);
 
   // The old width is restored.
   _move_splitter(mc.e("threadpane-splitter"), -diffWidth, 0);
-  actualWidth = mc.e("messagepaneboxwrapper").getBoundingClientRect().width;
+  actualWidth = mc.e("messagepaneboxwrapper").clientWidth;
 
   // FIXME: For whatever reasons the new width is off by two pixels on Mac OSX
   // But this test case is not for testing moving around a splitter but for
   // persistency. Therefore it is enough if the actual width is equal to the
   // the requested width plus/minus two pixels.
   assert_equals_fuzzy(oldWidth, actualWidth, 2,
     "The message pane width should be " + oldWidth + ", but is actually " +
     actualWidth);
@@ -339,17 +339,17 @@ function test_message_pane_width_persist
   // Wait for window close async session write to finish.
   controller.sleep(asyncFileWriteDelayMS);
 
   mc = open3PaneWindow();
   be_in_folder(folderA);
   assert_message_pane_visible();
   assert_pane_layout(kVerticalMailLayout);
 
-  actualWidth = mc.e("messagepaneboxwrapper").getBoundingClientRect().width;
+  actualWidth = mc.e("messagepaneboxwrapper").clientWidth;
   assert_equals(oldWidth, actualWidth, "The message pane width should be " +
     oldWidth + ", but is actually " + actualWidth);
 
   // The layout is reset to classical mail layout.
   set_pane_layout(kClassicMailLayout);
   assert_pane_layout(kClassicMailLayout);
 
   // We don't need the address book window any more.