| Index: chrome/test/functional/https.py
|
| ===================================================================
|
| --- chrome/test/functional/https.py (revision 124976)
|
| +++ chrome/test/functional/https.py (working copy)
|
| @@ -90,6 +90,44 @@
|
| self.assertEqual(self.GetActiveTabTitle(), first_page_title,
|
| msg="Did not go back to previous page correctly.")
|
|
|
| + def testSSLCertOK(self):
|
| + """Verify Certificate OK does not display interstitial page."""
|
| + url = self._https_server_ok.GetURL('google.html').spec()
|
| + self.NavigateToURL(url)
|
| + tab_proxy = self.GetBrowserWindow(0).GetTab(0)
|
| + success, page_type = tab_proxy.GetPageType()
|
| + self.assertTrue(success, msg='Could not determine the type of the page')
|
| + self.assertNotEqual(page_type, pyauto.PAGE_TYPE_INTERSTITIAL,
|
| + msg="Cert OK displayed interstitial page.")
|
| + self.assertEqual(page_type, pyauto.PAGE_TYPE_NORMAL,
|
| + msg="Cert OK displayed error page.")
|
|
|
| + def testSSLCertIsExpiredAndCertNameMismatches(self):
|
| + """Verify Certificate Expiration and Certificate Mismatched name."""
|
| + for server, cert_status_flag, msg in zip((self._https_server_expired,
|
| + self._https_server_mismatched),
|
| + (pyauto.CERT_STATUS_DATE_INVALID,
|
| + pyauto.CERT_STATUS_COMMON_NAME_INVALID),
|
| + ('Cert has not expired', 'Cert name does not mismatch')):
|
| + self.NavigateToURL(server.GetURL('google.html').spec())
|
| + success, result_dict = (
|
| + self.GetBrowserWindow(0).GetTab(0).GetSecurityState())
|
| + self.assertTrue(success, msg='Could not get security state info')
|
| + self.assertTrue(
|
| + result_dict['ssl_cert_status'] & pyauto.uint32_ptr.frompointer(
|
| + cert_status_flag).value(), msg=msg)
|
| +
|
| + def testSSLCertAuthorityOK(self):
|
| + """Verify Certificate OK is valid."""
|
| + self.NavigateToURL(
|
| + self._https_server_mismatched.GetURL('google.html').spec())
|
| + success, result_dict = self.GetBrowserWindow(0).GetTab(0).GetSecurityState()
|
| + self.assertTrue(success, msg='Could not get security state info')
|
| + self.assertFalse(
|
| + result_dict['ssl_cert_status'] & pyauto.uint32_ptr.frompointer(
|
| + pyauto.CERT_STATUS_AUTHORITY_INVALID).value(),
|
| + msg='Cert OK is invalid')
|
| +
|
| +
|
| if __name__ == '__main__':
|
| pyauto_functional.Main()
|
|
|