Bug 1291844 - Add negative test to restore windows. r=whimboo draft
authorErica Wright <ewright@mozilla.com>
Tue, 04 Jul 2017 15:58:25 -0400
changeset 604212 693f2c2627d7e5ecbf2b0c3e0f2fbac05be97167
parent 604170 211d4dd61025c0a40caea7a54c9066e051bdde8c
child 636128 807138ef99ff5488a97929a0fb553bb8d7ff3561
push id67003
push userbmo:ewright@mozilla.com
push dateWed, 05 Jul 2017 15:20:50 +0000
reviewerswhimboo
bugs1291844
milestone56.0a1
Bug 1291844 - Add negative test to restore windows. r=whimboo MozReview-Commit-ID: 8fQ1nc1I65H
testing/firefox-ui/tests/functional/sessionstore/manifest.ini
testing/firefox-ui/tests/functional/sessionstore/test_restore_windows_after_restart.py
--- a/testing/firefox-ui/tests/functional/sessionstore/manifest.ini
+++ b/testing/firefox-ui/tests/functional/sessionstore/manifest.ini
@@ -1,6 +1,5 @@
 [DEFAULT]
 tags = local
 
 [test_tabbar_session_restore_button.py]
 [test_restore_windows_after_restart.py]
-skip-if = (os == "win" || e10s) # Bug 1291844 and Bug 1228446
--- a/testing/firefox-ui/tests/functional/sessionstore/test_restore_windows_after_restart.py
+++ b/testing/firefox-ui/tests/functional/sessionstore/test_restore_windows_after_restart.py
@@ -58,17 +58,19 @@ class TestRestoreWindowsAfterRestart(Pup
         """ 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.
         """
         self.open_windows(self.test_windows)
         self.open_windows(self.private_windows, is_private=True)
 
-        self.restart()
+        self.marionette.quit(in_app=True)
+        self.marionette.start_session()
+        self.marionette.set_context('chrome')
 
         windows = self.puppeteer.windows.all
 
         # There's no guarantee that Marionette will return us an
         # iterator for the opened windows that will match the
         # order within our window list. Instead, we'll convert
         # the list of URLs within each open window to a set of
         # tuples that will allow us to do a direct comparison
@@ -77,16 +79,31 @@ class TestRestoreWindowsAfterRestart(Pup
         for win in windows:
             urls = tuple()
             for tab in win.tabbar.tabs:
                 urls = urls + tuple([tab.location])
             opened_windows.add(urls)
 
         self.assertEqual(opened_windows, self.test_windows)
 
+    def test_without_restore(self):
+        self.marionette.enforce_gecko_prefs({'browser.startup.page': 1})
+
+        self.open_windows(self.test_windows)
+        self.open_windows(self.private_windows, is_private=True)
+
+        self.marionette.quit(in_app=True)
+        self.marionette.start_session()
+        self.marionette.set_context('chrome')
+
+        windows = self.puppeteer.windows.all
+
+        # The 3 windows from setUp did not re-open.
+        self.assertEqual(len(windows), 1)
+
     def open_windows(self, window_sets, is_private=False):
         """ Opens a set of windows with tabs pointing at some
         URLs.
 
         @param window_sets (list)
                A set of URL tuples. Each tuple within window_sets
                represents a window, and each URL in the URL
                tuples represents what will be loaded in a tab.