Bug 1414776 - [fxui] Change testcases from mozqa.com to badssl.com and mixed-content-tests-mozilla.org. r=ato

MozReview-Commit-ID: DadY39FdZQT

--HG--
extra : rebase_source : cf9f5ed5ebd5a1b40763b1a5d1be5b4c59a9c915
This commit is contained in:
Henrik Skupin 2018-07-24 16:09:02 +02:00
Родитель 738ccdfb90
Коммит 33a541ade3
13 изменённых файлов: 32 добавлений и 40 удалений

Просмотреть файл

@ -15,7 +15,7 @@ class TestDVCertificate(PuppeteerMixin, MarionetteTestCase):
self.locationbar = self.browser.navbar.locationbar
self.identity_popup = self.browser.navbar.locationbar.identity_popup
self.url = 'https://ssl-dv.mozqa.com'
self.url = 'https://mozilla-intermediate.badssl.com'
def tearDown(self):
try:
@ -41,8 +41,9 @@ class TestDVCertificate(PuppeteerMixin, MarionetteTestCase):
cert = self.browser.tabbar.selected_tab.certificate
# The shown host equals to the certificate
self.assertEqual(self.identity_popup.view.main.host.get_property('textContent'),
cert['commonName'])
self.assertRegexpMatches(self.identity_popup.view.main.host.get_property('textContent'),
'.*badssl\.com$')
self.assertRegexpMatches(cert['commonName'], '.*badssl\.com$')
# Only the secure label is visible in the main view
secure_label = self.identity_popup.view.main.secure_connection_label
@ -75,8 +76,8 @@ class TestDVCertificate(PuppeteerMixin, MarionetteTestCase):
self.assertEqual(deck.selected_panel, deck.security)
self.assertEqual(deck.security.domain.get_property('value'),
cert['commonName'])
self.assertRegexpMatches(deck.security.domain.get_property('value'),
'.*badssl\.com$')
self.assertEqual(deck.security.owner.get_property('value'),
page_info_window.localize_property('securityNoOwner'))

Просмотреть файл

@ -15,7 +15,7 @@ class TestEVCertificate(PuppeteerMixin, MarionetteTestCase):
self.locationbar = self.browser.navbar.locationbar
self.identity_popup = self.locationbar.identity_popup
self.url = 'https://ssl-ev.mozqa.com/'
self.url = 'https://extended-validation.badssl.com'
def tearDown(self):
try:

Просмотреть файл

@ -7,6 +7,7 @@ from marionette_harness import MarionetteTestCase
class TestMixedContentPage(PuppeteerMixin, MarionetteTestCase):
def setUp(self):
super(TestMixedContentPage, self).setUp()
@ -14,7 +15,7 @@ class TestMixedContentPage(PuppeteerMixin, MarionetteTestCase):
self.locationbar = self.browser.navbar.locationbar
self.identity_popup = self.locationbar.identity_popup
self.url = 'https://mozqa.com/data/firefox/security/mixedcontent.html'
self.url = 'https://mixed.badssl.com'
def tearDown(self):
try:

Просмотреть файл

@ -12,7 +12,7 @@ class TestMixedScriptContentBlocking(PuppeteerMixin, MarionetteTestCase):
def setUp(self):
super(TestMixedScriptContentBlocking, self).setUp()
self.url = 'https://mozqa.com/data/firefox/security/mixed_content_blocked/index.html'
self.url = 'https://mixed-content-tests-mozilla.org/mozqa/mixed_content_blocked/'
self.test_elements = [
('result1', 'Insecure script one'),

Просмотреть файл

@ -17,11 +17,11 @@ class TestSecurityNotification(PuppeteerMixin, MarionetteTestCase):
self.urls = [
# Invalid cert page
'https://ssl-expired.mozqa.com',
'https://expired.badssl.com',
# Secure page
'https://ssl-ev.mozqa.com/',
'https://extended-validation.badssl.com',
# Insecure page
'http://no-ssl.mozqa.com'
'http://http.badssl.com'
]
self.identity_box = self.browser.navbar.locationbar.identity_box

Просмотреть файл

@ -15,7 +15,7 @@ class TestSSLDisabledErrorPage(PuppeteerMixin, MarionetteTestCase):
def setUp(self):
super(TestSSLDisabledErrorPage, self).setUp()
self.url = 'https://tlsv1-0.mozqa.com'
self.url = 'https://tls-v1-0.badssl.com:1010'
self.puppeteer.utils.sanitize({"sessions": True})
@ -49,12 +49,12 @@ class TestSSLDisabledErrorPage(PuppeteerMixin, MarionetteTestCase):
short_description = self.marionette.find_element(By.ID, 'errorShortDescText')
self.assertIn('SSL_ERROR_UNSUPPORTED_VERSION',
short_description.get_property('textContent'))
self.assertIn('mozqa.com', short_description.get_property('textContent'))
# Verify that the "Restore" button appears and works
reset_button = self.marionette.find_element(By.ID, 'prefResetButton')
reset_button.click()
# With the preferences reset, the page has to load correctly
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
expected.element_present(By.LINK_TEXT, 'http://quality.mozilla.org'))
el = Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
expected.element_present(By.TAG_NAME, 'h1'))
self.assertIn('tls-v1-0', el.get_property('innerText'))

Просмотреть файл

@ -14,19 +14,14 @@ class TestSSLStatusAfterRestart(PuppeteerMixin, MarionetteTestCase):
self.test_data = (
{
'url': 'https://ssl-dv.mozqa.com',
'url': 'https://mozilla-intermediate.badssl.com',
'identity': '',
'type': 'secure'
},
{
'url': 'https://ssl-ev.mozqa.com/',
'identity': 'Mozilla Corporation',
'url': 'https://extended-validation.badssl.com',
'identity': 'Mozilla Foundation',
'type': 'secure-ev'
},
{
'url': 'https://ssl-ov.mozqa.com/',
'identity': '',
'type': 'secure'
}
)

Просмотреть файл

@ -14,7 +14,7 @@ class TestSubmitUnencryptedInfoWarning(PuppeteerMixin, MarionetteTestCase):
def setUp(self):
super(TestSubmitUnencryptedInfoWarning, self).setUp()
self.url = 'https://ssl-dv.mozqa.com/data/firefox/security/unencryptedsearch.html'
self.url = 'https://mixed-form.badssl.com/'
self.test_string = 'mozilla'
# Disable rcwn to make cache behavior deterministic
@ -33,8 +33,8 @@ class TestSubmitUnencryptedInfoWarning(PuppeteerMixin, MarionetteTestCase):
self.marionette.navigate(self.url)
# Get the page's search box and submit button.
searchbox = self.marionette.find_element(By.ID, 'q')
button = self.marionette.find_element(By.ID, 'submit')
searchbox = self.marionette.find_element(By.ID, 'value')
button = self.marionette.find_element(By.CSS_SELECTOR, 'button')
# Use the page's search box to submit information.
searchbox.send_keys(self.test_string)
@ -63,6 +63,5 @@ class TestSubmitUnencryptedInfoWarning(PuppeteerMixin, MarionetteTestCase):
' document.readyState == "complete";')
)
# Check that search_term contains the test string.
search_term = self.marionette.find_element(By.ID, 'search-term')
self.assertEqual(search_term.get_property('textContent'), self.test_string)
self.assertEqual('http://http.badssl.com/resources/form-submitted.html',
self.marionette.get_url())

Просмотреть файл

@ -14,7 +14,7 @@ class TestUnknownIssuer(MarionetteTestCase):
def setUp(self):
super(TestUnknownIssuer, self).setUp()
self.url = 'https://ssl-unknownissuer.mozqa.com'
self.url = 'https://untrusted-root.badssl.com/'
def test_unknown_issuer(self):
with self.marionette.using_context('content'):

Просмотреть файл

@ -15,7 +15,7 @@ class TestUntrustedConnectionErrorPage(PuppeteerMixin, MarionetteTestCase):
def setUp(self):
super(TestUntrustedConnectionErrorPage, self).setUp()
self.url = 'https://ssl-selfsigned.mozqa.com'
self.url = 'https://self-signed.badssl.com'
# Disable rcwn to make cache behavior deterministic
self.marionette.set_pref('network.http.rcwn.enabled', False)

Просмотреть файл

@ -10,27 +10,25 @@ from marionette_harness import MarionetteTestCase
class TestSecurity(PuppeteerMixin, MarionetteTestCase):
def test_get_address_from_certificate(self):
url = 'https://ssl-ev.mozqa.com'
url = 'https://extended-validation.badssl.com'
with self.marionette.using_context(self.marionette.CONTEXT_CONTENT):
self.marionette.navigate(url)
cert = self.browser.tabbar.tabs[0].certificate
self.assertIn(cert['commonName'], url)
self.assertEqual(cert['organization'], 'Mozilla Corporation')
self.assertEqual(cert['organization'], 'Mozilla Foundation')
self.assertEqual(cert['issuerOrganization'], 'DigiCert Inc')
address = self.puppeteer.security.get_address_from_certificate(cert)
self.assertIsNotNone(address)
self.assertIsNotNone(address['city'])
self.assertIsNotNone(address['country'])
self.assertIsNotNone(address['postal_code'])
self.assertIsNotNone(address['state'])
self.assertIsNotNone(address['street'])
def test_get_certificate(self):
url_http = self.marionette.absolute_url('layout/mozilla.html')
url_https = 'https://ssl-ev.mozqa.com'
url_https = 'https://extended-validation.badssl.com'
# Test EV certificate
with self.marionette.using_context(self.marionette.CONTEXT_CONTENT):

Просмотреть файл

@ -207,7 +207,7 @@ class TestIdentityPopup(PuppeteerMixin, MarionetteTestCase):
self.locationbar = self.browser.navbar.locationbar
self.identity_popup = self.locationbar.identity_popup
self.url = 'https://ssl-ev.mozqa.com'
self.url = 'https://extended-validation.badssl.com'
with self.marionette.using_context('content'):
self.marionette.navigate(self.url)

Просмотреть файл

@ -26,9 +26,7 @@ class Security(BaseLib):
:returns: Address details as dictionary
"""
regex = re.compile('.*?L=(?P<city>.+?),ST=(?P<state>.+?),C=(?P<country>.+?)'
',postalCode=(?P<postal_code>.+?),STREET=(?P<street>.+?)'
',serial')
regex = re.compile('.*?L=(?P<city>.+?),ST=(?P<state>.+?),C=(?P<country>.+?),')
results = regex.search(certificate['subjectName'])
return results.groupdict() if results else results