Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: chrome/test/functional/https.py

Issue 9535022: Exposed GetSecurityState and GetPageType to pyAuto. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/pyautolib/pyautolib.i » ('j') | chrome/test/pyautolib/pyautolib.i » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « no previous file | chrome/test/pyautolib/pyautolib.i » ('j') | chrome/test/pyautolib/pyautolib.i » ('J')

Powered by Google App Engine
This is Rietveld 408576698