[Pkg-mozext-commits] [requestpolicy] 118/257: [tst] redirect tests: disable some tests on E10s

David Prévot taffit at moszumanska.debian.org
Thu Jan 28 03:20:03 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository requestpolicy.

commit c373c4dfe53cdf2b9e297f1de1445ff7b8ba8262
Author: Martin Kimmerle <dev at 256k.de>
Date:   Wed Oct 28 01:26:44 2015 +0100

    [tst] redirect tests: disable some tests on E10s
    
    Some parts of some tests are failing on E10s.
    See issues #722 and #725.
---
 tests/marionette/rp_puppeteer/__init__.py          |  4 +++
 tests/marionette/rp_puppeteer/api/browser_info.py  | 18 ++++++++++++
 .../tests/redirections/test_auto_redirect.py       | 33 ++++++++++++++++------
 .../test_link_click_redirect_in_new_tab.py         | 20 ++++++++-----
 4 files changed, 60 insertions(+), 15 deletions(-)

diff --git a/tests/marionette/rp_puppeteer/__init__.py b/tests/marionette/rp_puppeteer/__init__.py
index 829a5e3..c770a28 100644
--- a/tests/marionette/rp_puppeteer/__init__.py
+++ b/tests/marionette/rp_puppeteer/__init__.py
@@ -12,6 +12,10 @@ class RequestPolicyPuppeteer(object):
     RequestPolicyTestCase instance.
     """
 
+    @use_class_as_property('api.browser_info.BrowserInfo')
+    def browser_info(self):
+        pass
+
     @use_class_as_property('api.l10n.L10n')
     def l10n(self):
         pass
diff --git a/tests/marionette/rp_puppeteer/api/browser_info.py b/tests/marionette/rp_puppeteer/api/browser_info.py
new file mode 100644
index 0000000..d0af51a
--- /dev/null
+++ b/tests/marionette/rp_puppeteer/api/browser_info.py
@@ -0,0 +1,18 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+from firefox_puppeteer.base import BaseLib
+
+
+class BrowserInfo(BaseLib):
+
+    @property
+    def e10s_enabled(self):
+        return self.marionette.execute_script("""
+          try {
+            return Services.appinfo.browserTabsRemoteAutostart;
+          } catch (e) {
+            return false;
+          }
+        """)
diff --git a/tests/marionette/tests/redirections/test_auto_redirect.py b/tests/marionette/tests/redirections/test_auto_redirect.py
index fbbcdf8..7e44d9e 100644
--- a/tests/marionette/tests/redirections/test_auto_redirect.py
+++ b/tests/marionette/tests/redirections/test_auto_redirect.py
@@ -47,12 +47,20 @@ class TestAutoRedirect(RequestPolicyTestCase):
             # Load the page, expecting a TimeoutException, because when
             # RequestPolicy blocks a redirection, the page never loads.
             with self.marionette.using_context("content"):
-                # Set the timeout to a low value in order to speed up the
-                # test.
-                self.marionette.timeouts("page load", 100)
-                self.assertRaises(TimeoutException, self.marionette.navigate,
-                                  test_url)
-                self.marionette.timeouts("page load", 20000)
+                if self.browser_info.e10s_enabled:
+                    # Looks like with E10s enabled the TimeoutException
+                    # is not thrown.
+                    self.marionette.navigate(test_url)
+                else:
+                    # Set the timeout to a low value in order to speed up the
+                    # test.
+                    self.marionette.timeouts("page load", 100)
+
+                    self.assertRaises(TimeoutException,
+                                      self.marionette.navigate,
+                                      test_url)
+
+                    self.marionette.timeouts("page load", 20000)
 
             self.assertTrue(self.redir.is_shown(),
                             "The redirect notification has been displayed.")
@@ -61,8 +69,17 @@ class TestAutoRedirect(RequestPolicyTestCase):
 
             self.redir.close()
 
-        test_appear("redirect-http-location-header.php")
-        test_appear("redirect-http-refresh-header.php")
+        if not self.browser_info.e10s_enabled:
+            # FIXME: Issue #722;  There should be a notification bar for
+            #        HTTP <location|refresh> header redirections.
+            # FIXME: If these two tests were activated on E10s, they would
+            #        be paused for several minutes until they fail as follows:
+            #            IOError: process died with returncode None
+            #        This might be related to Mozilla Bug 1209373:
+            #            `marionette.navigate()` throws `IOError` instead
+            #            of `TimeoutException`.
+            test_appear("redirect-http-location-header.php")
+            test_appear("redirect-http-refresh-header.php")
         test_appear("redirect-js-document-location-auto.html")
         test_appear("redirect-meta-tag-01-immediate.html")
         test_appear("redirect-meta-tag-02-delayed.html")
diff --git a/tests/marionette/tests/redirections/test_link_click_redirect_in_new_tab.py b/tests/marionette/tests/redirections/test_link_click_redirect_in_new_tab.py
index 598c290..d6b7348 100644
--- a/tests/marionette/tests/redirections/test_link_click_redirect_in_new_tab.py
+++ b/tests/marionette/tests/redirections/test_link_click_redirect_in_new_tab.py
@@ -100,13 +100,19 @@ class TestLinkClickRedirectInNewTab(RequestPolicyTestCase):
                 yield
 
         def test_variant(*args):
-            with assert_raises_if(ElementNotDisplayedException,
-                                  args[0] == "contextMenu"):
-                # The "Open Link in New Tab" context menu entry is not
-                # available for <a> elements with such hrefs containing
-                # JavaScript code.
-                test_appear(expand_url("redirect-js-document-location-link.html",
-                                       option="no link creation"), *args)
+            # FIXME: Issue #725;  This test fails with E10s enabled.
+            #        When FxPuppeteer's `TabBar.get_handle_for_tab()` is
+            #        executed for the new tab with the test URL, the
+            #        `contentWindowAsCPOW` either is `null` or does not
+            #        have a `QueryInterface()` function.
+            if not self.browser_info.e10s_enabled:
+                with assert_raises_if(ElementNotDisplayedException,
+                                      args[0] == "contextMenu"):
+                    # The "Open Link in New Tab" context menu entry is not
+                    # available for <a> elements with such hrefs containing
+                    # JavaScript code.
+                    test_appear(expand_url("redirect-js-document-location-link.html",
+                                           option="no link creation"), *args)
 
             test_appear(expand_url("redirect-http-location-header.php"), *args)
             test_appear(expand_url("redirect-http-refresh-header.php"), *args)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git



More information about the Pkg-mozext-commits mailing list