Bug 1388627 - Remove obsolete Wait.until() calls from Window Manager Mixin. draft
authorHenrik Skupin <mail@hskupin.info>
Wed, 09 Aug 2017 10:23:09 +0200
changeset 643080 79ecc1ad1eb96e62f1598312b9846f61a773fd33
parent 642518 a921bfb8a2cf3db4d9edebe9b35799a3f9d035da
child 643081 5d3073ff8eb1033d3a7e65603d8ef6fc2d94575a
push id72984
push userbmo:hskupin@gmail.com
push dateWed, 09 Aug 2017 08:41:10 +0000
bugs1388627
milestone57.0a1
Bug 1388627 - Remove obsolete Wait.until() calls from Window Manager Mixin. Given that both 'close' and 'close_chrome_window' wait for the underlying tab or window to be closed, there is not need to explicitely wait in tests. MozReview-Commit-ID: HOGgqzkNE9d
testing/marionette/harness/marionette_harness/runner/mixins/window_manager.py
--- a/testing/marionette/harness/marionette_harness/runner/mixins/window_manager.py
+++ b/testing/marionette/harness/marionette_harness/runner/mixins/window_manager.py
@@ -36,43 +36,31 @@ class WindowManagerMixin(object):
         if self.start_tab not in current_window_handles:
             self.start_tab = current_window_handles[0]
 
         current_window_handles.remove(self.start_tab)
         for handle in current_window_handles:
             self.marionette.switch_to_window(handle)
             self.marionette.close()
 
-            # Bug 1311350 - close() doesn't wait for tab to be closed.
-            Wait(self.marionette).until(
-                lambda mn: handle not in mn.window_handles,
-                message="Failed to close tab with handle {}".format(handle)
-            )
-
         self.marionette.switch_to_window(self.start_tab)
 
     def close_all_windows(self):
         current_chrome_window_handles = self.marionette.chrome_window_handles
 
         # If the start window is not present anymore, use the next one of the list
         if self.start_window not in current_chrome_window_handles:
             self.start_window = current_chrome_window_handles[0]
         current_chrome_window_handles.remove(self.start_window)
 
         with self.marionette.using_context("chrome"):
             for handle in current_chrome_window_handles:
                 self.marionette.switch_to_window(handle)
                 self.marionette.close_chrome_window()
 
-                # Bug 1311350 - close_chrome_window() doesn't wait for window to be closed.
-                Wait(self.marionette).until(
-                    lambda mn: handle not in mn.chrome_window_handles,
-                    message="Failed to close window with handle {}".format(handle)
-                )
-
             self.marionette.switch_to_window(self.start_window)
 
     def open_tab(self, trigger="menu"):
         current_tabs = self.marionette.window_handles
 
         try:
             if callable(trigger):
                 trigger()