blob: ee48c09c9db86a9fd6b02be6c18812aae597605f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/usr/bin/env python
# Copyright (c) 2011 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.
import os
import pyauto_functional # Must be imported before pyauto
import pyauto
class HTTPSTest(pyauto.PyUITest):
"""TestCase for SSL."""
def Debug(self):
"""Test method for experimentation.
This method will not run automatically.
Use: python chrome/test/functional/ssl.py ssl.SSLTest.Debug
"""
while True:
raw_input('Hit <enter> to dump info.. ')
self.pprint(self.GetNavigationInfo())
def testSSLPageBasic(self):
"""Verify the navigation state in an https page."""
self.NavigateToURL('https://www.google.com')
self.assertTrue(self.WaitUntil(
lambda: self.GetNavigationInfo()['ssl']['security_style'],
expect_retval='SECURITY_STYLE_AUTHENTICATED'))
ssl = self.GetNavigationInfo()['ssl']
self.assertFalse(ssl['displayed_insecure_content'])
self.assertFalse(ssl['ran_insecure_content'])
if __name__ == '__main__':
pyauto_functional.Main()
|