Bug 1304004 - Fix regression in firefox-ui security tests caused by bug 1303291. r=keeler, a=test-only
☠☠ backed out by ad173f0c7451 ☠ ☠
authorHenrik Skupin <mail@hskupin.info>
Wed, 19 Oct 2016 14:26:12 +0200
changeset 356226 6f60e5a233b811c9a5b143781010e41c12c25c08
parent 356225 1f35cc719c5755327684736e561387c3f6f09a9a
child 356227 6502acd51a449dc05f52a41e3e8933334e948178
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskeeler, test-only
bugs1304004, 1303291
milestone51.0a2
Bug 1304004 - Fix regression in firefox-ui security tests caused by bug 1303291. r=keeler, a=test-only 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,19 +24,20 @@ class TestDVCertificate(FirefoxTestCase)
             self.windows.close_all([self.browser])
         finally:
             FirefoxTestCase.tearDown(self)
 
     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'))
+        # The correct lock icon should be shown
+        icon = self.locationbar.connection_icon
+        self.assertEqual('url("chrome://browser/skin/connection-secure.svg")',
+                         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
--- a/testing/firefox-ui/tests/functional/security/test_ev_certificate.py
+++ b/testing/firefox-ui/tests/functional/security/test_ev_certificate.py
@@ -24,19 +24,20 @@ class TestEVCertificate(FirefoxTestCase)
             self.windows.close_all([self.browser])
         finally:
             FirefoxTestCase.tearDown(self)
 
     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'))
+        # The correct lock icon should be shown
+        icon = self.locationbar.connection_icon
+        self.assertEqual('url("chrome://browser/skin/connection-secure.svg")',
+                         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.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
@@ -19,18 +19,23 @@ class TestMixedContentPage(FirefoxTestCa
             self.identity_popup.close(force=True)
         finally:
             FirefoxTestCase.tearDown(self)
 
     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'))
+        # The correct lock icon should be shown
+        icon = self.locationbar.connection_icon
+        self.assertEqual('url("chrome://browser/skin/connection-mixed-passive-loaded.svg#icon")',
+                         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,35 +27,39 @@ class TestMixedScriptContentBlocking(Fir
     def tearDown(self):
         try:
             self.identity_popup.close(force=True)
         finally:
             FirefoxTestCase.tearDown(self)
 
     def _expect_protection_status(self, enabled):
         if enabled:
-            color, icon_filename, state = (
+            color, icon_filename, identity, state = (
                 'rgb(0, 136, 0)',
-                'identity-secure',
+                'url("chrome://browser/skin/connection-secure.svg")',
+                'verifiedDomain mixedActiveBlocked',
                 'blocked'
             )
         else:
-            color, icon_filename, state = (
+            color, icon_filename, identity, state = (
                 'rgb(255, 0, 0)',
-                'identity-mixed-active-loaded',
+                'url("chrome://browser/skin/connection-mixed-active-loaded.svg#icon")',
+                '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 _: connection_icon.value_of_css_property('list-style-image') == icon_filename,
+            message='Connection icon "{}" is not set'.format(icon_filename)
         )
 
+        self.assertEqual(self.locationbar.identity_box.get_attribute('className'), 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))
                 )