Bug 1304004 - Fix regression in firefox-ui security tests caused by bug 1303291. draft
authorHenrik Skupin <mail@hskupin.info>
Mon, 14 Nov 2016 21:09:16 +0100
changeset 438570 abfd43bbe31144585110ad0be46f4ff0c47a186d
parent 438550 71fd23fa0803a548b6e571aa25d0533a06cd0421
child 536952 695f4d3a291c081546f815d27ccbd7f213311a91
push id35767
push userbmo:hskupin@gmail.com
push dateMon, 14 Nov 2016 20:17:58 +0000
bugs1304004, 1303291
milestone53.0a1
Bug 1304004 - Fix regression in firefox-ui security tests caused by bug 1303291. MozReview-Commit-ID: Co7efI9jgeC
testing/firefox-ui/tests/functional/security/manifest.ini
testing/firefox-ui/tests/functional/security/test_dv_certificate.py
testing/firefox-ui/tests/functional/security/test_ev_certificate.py
testing/firefox-ui/tests/functional/security/test_mixed_content_page.py
testing/firefox-ui/tests/functional/security/test_mixed_script_content_blocking.py
--- a/testing/firefox-ui/tests/functional/security/manifest.ini
+++ b/testing/firefox-ui/tests/functional/security/manifest.ini
@@ -1,21 +1,17 @@
 [DEFAULT]
 tags = remote
 
 [test_dv_certificate.py]
-skip-if = true # 1304004
 [test_enable_privilege.py]
 tags = local
 [test_ev_certificate.py]
-skip-if = true # 1304004
 [test_mixed_content_page.py]
-skip-if = true # 1304004
 [test_mixed_script_content_blocking.py]
-skip-if = true # 1304004
 [test_no_certificate.py]
 tags = local
 [test_safe_browsing_initial_download.py]
 [test_safe_browsing_notification.py]
 [test_safe_browsing_warning_pages.py]
 [test_security_notification.py]
 [test_ssl_disabled_error_page.py]
 [test_ssl_status_after_restart.py]
--- a/testing/firefox-ui/tests/functional/security/test_dv_certificate.py
+++ b/testing/firefox-ui/tests/functional/security/test_dv_certificate.py
@@ -24,20 +24,16 @@ class TestDVCertificate(PuppeteerMixin, 
             self.puppeteer.windows.close_all([self.browser])
         finally:
             super(TestDVCertificate, self).tearDown()
 
     def test_dv_cert(self):
         with self.marionette.using_context('content'):
             self.marionette.navigate(self.url)
 
-        # The lock icon should be shown
-        self.assertIn('identity-secure',
-                      self.locationbar.connection_icon.value_of_css_property('list-style-image'))
-
         self.assertEqual(self.locationbar.identity_box.get_attribute('className'),
                          'verifiedDomain')
 
         # Open the identity popup
         self.locationbar.open_identity_popup()
 
         # Check the identity popup doorhanger
         self.assertEqual(self.identity_popup.element.get_attribute('connection'), 'secure')
--- a/testing/firefox-ui/tests/functional/security/test_ev_certificate.py
+++ b/testing/firefox-ui/tests/functional/security/test_ev_certificate.py
@@ -24,20 +24,16 @@ class TestEVCertificate(PuppeteerMixin, 
             self.puppeteer.windows.close_all([self.browser])
         finally:
             super(TestEVCertificate, self).tearDown()
 
     def test_ev_certificate(self):
         with self.marionette.using_context('content'):
             self.marionette.navigate(self.url)
 
-        # The lock icon should be shown
-        self.assertIn('identity-secure',
-                      self.locationbar.connection_icon.value_of_css_property('list-style-image'))
-
         # Check the identity box
         self.assertEqual(self.locationbar.identity_box.get_attribute('className'),
                          'verifiedIdentity')
 
         # Get the information from the certificate
         cert = self.browser.tabbar.selected_tab.certificate
         address = self.puppeteer.security.get_address_from_certificate(cert)
 
--- a/testing/firefox-ui/tests/functional/security/test_mixed_content_page.py
+++ b/testing/firefox-ui/tests/functional/security/test_mixed_content_page.py
@@ -20,18 +20,18 @@ class TestMixedContentPage(PuppeteerMixi
             self.identity_popup.close(force=True)
         finally:
             super(TestMixedContentPage, self).tearDown()
 
     def test_mixed_content(self):
         with self.marionette.using_context('content'):
             self.marionette.navigate(self.url)
 
-        self.assertIn('identity-mixed-passive-loaded',
-                      self.locationbar.connection_icon.value_of_css_property('list-style-image'))
+        self.assertEqual(self.locationbar.identity_box.get_attribute('className'),
+                         'unknownIdentity mixedDisplayContent')
 
         # Open the identity popup
         self.locationbar.open_identity_popup()
 
         # Only the insecure label is visible in the main view
         secure_label = self.identity_popup.view.main.secure_connection_label
         self.assertEqual(secure_label.value_of_css_property('display'), 'none')
 
--- a/testing/firefox-ui/tests/functional/security/test_mixed_script_content_blocking.py
+++ b/testing/firefox-ui/tests/functional/security/test_mixed_script_content_blocking.py
@@ -27,33 +27,32 @@ class TestMixedScriptContentBlocking(Pup
     def tearDown(self):
         try:
             self.identity_popup.close(force=True)
         finally:
             super(TestMixedScriptContentBlocking, self).tearDown()
 
     def _expect_protection_status(self, enabled):
         if enabled:
-            color, icon_filename, state = (
+            color, identity, state = (
                 'rgb(0, 136, 0)',
-                'identity-secure',
+                'verifiedDomain mixedActiveBlocked',
                 'blocked'
             )
         else:
-            color, icon_filename, state = (
+            color, identity, state = (
                 'rgb(255, 0, 0)',
-                'identity-mixed-active-loaded',
+                'unknownIdentity mixedActiveContent',
                 'unblocked'
             )
 
         # First call to Wait() needs a longer timeout due to the reload of the web page.
-        connection_icon = self.locationbar.connection_icon
         Wait(self.marionette, timeout=self.browser.timeout_page_load).until(
-            lambda _: icon_filename in connection_icon.value_of_css_property('list-style-image'),
-            message="The correct icon is displayed"
+            lambda _: self.locationbar.identity_box.get_attribute('className') == identity,
+            message='Expected identity "{}" not found'.format(identity)
         )
 
         with self.marionette.using_context('content'):
             for identifier, description in self.test_elements:
                 el = self.marionette.find_element(By.ID, identifier)
                 Wait(self.marionette).until(
                     lambda mn: el.value_of_css_property('color') == color,
                     message=("%s has been %s" % (description, state))