Bug 1333736 - Disable usage of new tab page by default. r=maja_zf
authorHenrik Skupin <mail@hskupin.info>
Wed, 25 Jan 2017 14:50:24 +0100
changeset 331651 c60b3d435a5bdc0bace3470706375cfa12b8f825
parent 331650 4424944b72fc28a2a82ac39cfb62571c144b4409
child 331652 286078321ed3cdfe23efacf7d0e66a4febfe40f1
push id31280
push userkwierso@gmail.com
push dateMon, 30 Jan 2017 23:22:12 +0000
treeherdermozilla-central@2b11b3e60ca6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf
bugs1333736
milestone54.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 1333736 - Disable usage of new tab page by default. r=maja_zf 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>