Bug 1510952 - Hide Today Pane to fix failing test quick-filter-bar/test-display-issues.js. r=jorgk
authorGeoff Lankow <geoff@darktrojan.net>
Sun, 02 Dec 2018 11:10:21 +1300
changeset 33838 a04f9cd37145330e23e94c04933ac3ab69e1608d
parent 33837 d8d0149c9c8806ff81fcdab3d18cf35f7b30083a
child 33839 140498abac70cc52fb1d91d73d100eadbff14795
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersjorgk
bugs1510952
Bug 1510952 - Hide Today Pane to fix failing test quick-filter-bar/test-display-issues.js. r=jorgk
mail/test/mozmill/quick-filter-bar/test-display-issues.js
--- a/mail/test/mozmill/quick-filter-bar/test-display-issues.js
+++ b/mail/test/mozmill/quick-filter-bar/test-display-issues.js
@@ -20,32 +20,45 @@ var MODULE_REQUIRES = ["folder-display-h
 
 var folder;
 var setUnstarred, setStarred;
 var gOriginalPaneWidth;
 
 var gEnlargedWindowWidth = 1260;
 var gShrunkenWindowWidth = 600;
 
+var gTodayPane;
+
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
 
   folder = create_folder("QuickFilterBarDisplayIssues");
   be_in_folder(folder);
 
   // Let's check window dimensions so we can enlarge from them.
   assert_default_window_size();
   assert_true(gEnlargedWindowWidth > gDefaultWindowWidth,
               "Main window too large for the test logic");
 
   // Store folder pane width that we will change temporarily.
   let folderPaneBox = mc.e("folderPaneBox");
   gOriginalPaneWidth = folderPaneBox.width;
+
+  // Hide Lightning's Today pane as it takes up too much room in the
+  // small TB window our tests run in.
+  gTodayPane = mc.e("today-pane-panel");
+  if (gTodayPane) {
+    if (!gTodayPane.collapsed) {
+      mc.keypress(null, "VK_F11", {});
+    } else {
+      gTodayPane = null;
+    }
+  }
 }
 
 /**
  * When the window gets too narrow the collapsible button labels need to get
  *  gone.  Then they need to come back when we get large enough again.
  *
  * Because the mozmill window sizing is weird and confusing, we force our size
  *  in both cases but do save/restore around our test.
@@ -103,17 +116,16 @@ function test_buttons_collapse_and_expan
   assertCollapsed();
 
   // -- GIANT again!
   resize_to(mc, gEnlargedWindowWidth, gDefaultWindowHeight);
   collapse_panes(mc.e("folderpane_splitter"), true);
   logState("giant again!");
   assertExpanded();
 }
-test_buttons_collapse_and_expand.EXCLUDED_PLATFORMS = ["linux"];
 
 function test_buttons_collapse_and_expand_on_spawn_in_vertical_mode() {
   // Assume we're in classic layout to start - since this is where we'll
   // reset to once we're done.
   assert_pane_layout(kClassicMailLayout);
 
   // Put us in vertical mode
   set_pane_layout(kVerticalMailLayout);
@@ -136,9 +148,13 @@ function test_buttons_collapse_and_expan
 }
 
 function teardownModule() {
   // Restore the window to original layout.
   restore_default_window_size();
   collapse_panes(mc.e("folderpane_splitter"), false);
   let folderPaneBox = mc.e("folderPaneBox");
   folderPaneBox.width = gOriginalPaneWidth;
+
+  if (gTodayPane && gTodayPane.collapsed) {
+    mc.keypress(null, "VK_F11", {});
+  }
 }