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

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, 9 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 | « chrome/chrome_tests.gypi ('k') | chrome/test/pyautolib/pyautolib.i » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/https.py
===================================================================
--- chrome/test/functional/https.py (revision 126775)
+++ chrome/test/functional/https.py (working copy)
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -90,6 +90,46 @@
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.
+ This test also asserts that the page type is normal.
+ """
+ url = self._https_server_ok.GetURL('google.html').spec()
+ self.NavigateToURL(url)
+ tab_proxy = self.GetBrowserWindow(0).GetTab(0)
+ result_dict = tab_proxy.GetPageType()
+ self.assertTrue(result_dict, msg='Could not determine the type of the page')
+ self.assertEqual(
+ result_dict['page_type'], pyauto.PAGE_TYPE_NORMAL,
+ msg="Cert OK displayed page type %s." % result_dict['page_type'])
+
+ 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())
+ result_dict = self.GetBrowserWindow(0).GetTab(0).GetSecurityState()
+ self.assertTrue(result_dict, 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())
+ result_dict = self.GetBrowserWindow(0).GetTab(0).GetSecurityState()
+ self.assertTrue(result_dict, 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 | « chrome/chrome_tests.gypi ('k') | chrome/test/pyautolib/pyautolib.i » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698