Bug 1466071: Part 3: Test session save when quitting quickly. r=whimboo
authorAdam Gashlin <agashlin@mozilla.com>
Fri, 08 Jun 2018 09:09:07 -0700
changeset 422548 cf89498e0dec
parent 422547 56381f46d1d9
child 422549 25ff84f2bac3
push id34138
push userdluca@mozilla.com
push dateFri, 15 Jun 2018 02:39:59 +0000
treeherdermozilla-central@e51f8dbf0397 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1466071
milestone62.0a1
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
Bug 1466071: Part 3: Test session save when quitting quickly. r=whimboo
testing/firefox-ui/tests/functional/sessionstore/test_restore_windows_after_restart_and_quit.py
testing/firefox-ui/tests/functional/sessionstore/test_restore_windows_after_windows_shutdown.py
--- a/testing/firefox-ui/tests/functional/sessionstore/test_restore_windows_after_restart_and_quit.py
+++ b/testing/firefox-ui/tests/functional/sessionstore/test_restore_windows_after_restart_and_quit.py
@@ -5,19 +5,25 @@
 # add this directory to the path
 import sys
 import os
 sys.path.append(os.path.dirname(__file__))
 
 from session_store_test_case import SessionStoreTestCase
 
 
-class TestSessionStoreEnabled(SessionStoreTestCase):
-    def setUp(self):
-        super(TestSessionStoreEnabled, self).setUp(startup_page=3)
+class TestSessionStoreEnabledAllWindows(SessionStoreTestCase):
+
+    def setUp(self, include_private=True):
+        """ Setup for the test, enabling session restore.
+
+        :param include_private: Whether to open private windows.
+        """
+        super(TestSessionStoreEnabledAllWindows, self).setUp(
+            include_private=include_private, startup_page=3)
 
     def test_with_variety(self):
         """ Test opening and restoring both standard and private windows.
 
         Opens a set of windows, both standard and private, with
         some number of tabs in them. Once the tabs have loaded, restarts
         the browser, and then ensures that the standard tabs have been
         restored, and that the private ones have not.
@@ -33,17 +39,24 @@ class TestSessionStoreEnabled(SessionSto
 
         current_windows_set = self.convert_open_windows_to_set()
         self.assertEqual(current_windows_set, self.test_windows,
                          msg="""Non private browsing windows should have
                          been restored. Expected {}, got {}.
                          """.format(self.test_windows, current_windows_set))
 
 
+class TestSessionStoreEnabledNoPrivateWindows(TestSessionStoreEnabledAllWindows):
+
+    def setUp(self):
+        super(TestSessionStoreEnabledNoPrivateWindows, self).setUp(include_private=False)
+
+
 class TestSessionStoreDisabled(SessionStoreTestCase):
+
     def test_no_restore_with_quit(self):
         current_windows_set = self.convert_open_windows_to_set()
         self.assertEqual(current_windows_set, self.all_windows,
                          msg='Not all requested windows have been opened. Expected {}, got {}.'
                          .format(self.all_windows, current_windows_set))
 
         self.marionette.quit(in_app=True)
         self.marionette.start_session()
--- a/testing/firefox-ui/tests/functional/sessionstore/test_restore_windows_after_windows_shutdown.py
+++ b/testing/firefox-ui/tests/functional/sessionstore/test_restore_windows_after_windows_shutdown.py
@@ -6,16 +6,17 @@
 import sys
 import os
 sys.path.append(os.path.dirname(__file__))
 
 from session_store_test_case import SessionStoreTestCase
 
 
 class TestSessionStoreWindowsShutdown(SessionStoreTestCase):
+
     def setUp(self):
         super(TestSessionStoreWindowsShutdown, self).setUp(startup_page=3, no_auto_updates=False)
 
     def test_with_variety(self):
         """ Test restoring a set of windows across Windows shutdown.
 
         Opens a set of windows, both standard and private, with
         some number of tabs in them. Once the tabs have loaded, shuts down