Bug 1333736 - Disable usage of new tab page by default. draft
authorHenrik Skupin <mail@hskupin.info>
Wed, 25 Jan 2017 14:50:24 +0100
changeset 467903 7f29851d6d83a6229c4b41adc004f299439411c0
parent 467834 71224049c0b52ab190564d3ea0eab089a159a4cf
child 543798 f16ce7446a587b64d4644121916c43cd37326c26
push id43299
push userbmo:hskupin@gmail.com
push dateMon, 30 Jan 2017 09:50:59 +0000
bugs1333736
milestone54.0a1
Bug 1333736 - Disable usage of new tab page by default. Now that Marionette can load about:blank multiple times right after each other there is no need to prevent using it when turning of the new tab page. test_about_blank_for_new_docshell can also be updated by using a new tab for the test. This also gives us a new docshell and can also be run for Fennec. MozReview-Commit-ID: GWxtsH3nQt
testing/marionette/client/marionette_driver/geckoinstance.py
testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py
testing/marionette/harness/marionette_harness/www/windowHandles.html
--- a/testing/marionette/client/marionette_driver/geckoinstance.py
+++ b/testing/marionette/client/marionette_driver/geckoinstance.py
@@ -381,20 +381,18 @@ class DesktopInstance(GeckoInstance):
 
         # Indicate that the download panel has been shown once so that whichever
         # download test runs first doesn"t show the popup inconsistently
         "browser.download.panel.shown": True,
 
         # Do not show the EULA notification which can interfer with tests
         "browser.EULA.override": True,
 
-        # Bug 1145668, 1312674
-        # Turn off once Marionette can correctly handle error pages, and doesn't
-        # hang when about:blank gets loaded twice
-        "browser.newtabpage.enabled": True,
+        # Turn off about:newtab and make use of about:blank instead for new opened tabs
+        "browser.newtabpage.enabled": False,
         # Assume the about:newtab page"s intro panels have been shown to not depend on
         # which test runs first and happens to open about:newtab
         "browser.newtabpage.introShown": True,
 
         # Background thumbnails in particular cause grief, and disabling thumbnails
         # in general can"t hurt - we re-enable them when tests need them
         "browser.pagethumbnails.capturing_disabled": True,
 
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py
@@ -153,23 +153,28 @@ class TestNavigate(WindowManagerMixin, M
     def test_fragment(self):
         doc = inline("<p id=foo>")
         self.marionette.navigate(doc)
         self.marionette.execute_script("window.visited = true", sandbox=None)
         self.marionette.navigate("%s#foo" % doc)
         self.assertTrue(self.marionette.execute_script(
             "return window.visited", sandbox=None))
 
-    @skip_if_mobile("Fennec doesn't support other chrome windows")
+    @skip_if_mobile("Bug 1334095 - Timeout: No new tab has been opened")
     def test_about_blank_for_new_docshell(self):
         """ Bug 1312674 - Hang when loading about:blank for a new docshell."""
-        # Open a window to get a new docshell created for the first tab
-        with self.marionette.using_context("chrome"):
-            tab = self.open_tab(lambda: self.marionette.execute_script(" window.open() "))
-            self.marionette.switch_to_window(tab)
+        def open_with_link():
+            link = self.marionette.find_element(By.ID, "new-blank-tab")
+            link.click()
+
+        # Open a new tab to get a new docshell created
+        self.marionette.navigate(self.marionette.absolute_url("windowHandles.html"))
+        new_tab = self.open_tab(trigger=open_with_link)
+        self.marionette.switch_to_window(new_tab)
+        self.assertEqual(self.marionette.get_url(), "about:blank")
 
         self.marionette.navigate('about:blank')
         self.marionette.close()
         self.marionette.switch_to_window(self.start_window)
 
     def test_error_on_tls_navigation(self):
         self.assertRaises(errors.InsecureCertificateException,
                           self.marionette.navigate, self.fixtures.where_is("/test.html", on="https"))
--- a/testing/marionette/harness/marionette_harness/www/windowHandles.html
+++ b/testing/marionette/harness/marionette_harness/www/windowHandles.html
@@ -3,12 +3,14 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <!DOCTYPE html>
 <html>
 <head>
 <title>Marionette New Tab Link</title>
 </head>
 <body>
-  <a href="empty.html" id="new-tab" target="_blank">Click me!</a>
-  <a href="" id="new-window" onClick='javascript:window.open("empty.html", null, "location=1,toolbar=1");'>Click me!</a>
+  <a href="empty.html" id="new-tab" target="_blank">New Tab</a>
+  <a href="about:blank" id="new-blank-tab" target="_blank">New blank Tab</a>
+
+  <a href="" id="new-window" onClick='javascript:window.open("empty.html", null, "location=1,toolbar=1");'>New Window</a>
 </body>
 </html>