OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/time.h" | 5 #include "base/time.h" |
6 #include "chrome/app/chrome_dll_resource.h" | 6 #include "chrome/app/chrome_dll_resource.h" |
7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
10 #include "chrome/browser/tab_contents/interstitial_page.h" | 10 #include "chrome/browser/tab_contents/interstitial_page.h" |
11 #include "chrome/browser/tab_contents/navigation_entry.h" | 11 #include "chrome/browser/tab_contents/navigation_entry.h" |
12 #include "chrome/browser/tab_contents/tab_contents.h" | 12 #include "chrome/browser/tab_contents/tab_contents.h" |
13 #include "chrome/browser/tabs/tab_strip_model.h" | 13 #include "chrome/browser/tabs/tab_strip_model.h" |
14 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
15 #include "chrome/test/in_process_browser_test.h" | 15 #include "chrome/test/in_process_browser_test.h" |
16 #include "chrome/test/ui_test_utils.h" | 16 #include "chrome/test/ui_test_utils.h" |
17 #include "net/base/cert_status_flags.h" | 17 #include "net/base/cert_status_flags.h" |
18 #include "net/test/test_server.h" | 18 #include "net/test/test_server.h" |
19 | 19 |
20 const FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data"); | 20 const FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data"); |
21 | 21 |
22 class SSLUITest : public InProcessBrowserTest { | 22 class SSLUITest : public InProcessBrowserTest { |
| 23 typedef net::TestServer::HTTPSOptions HTTPSOptions; |
| 24 |
23 public: | 25 public: |
24 SSLUITest() | 26 SSLUITest() |
25 : https_server_(net::TestServer::TYPE_HTTPS, FilePath(kDocRoot)), | 27 : https_server_( |
26 https_server_expired_(net::TestServer::TYPE_HTTPS_EXPIRED_CERTIFICATE, | 28 HTTPSOptions(HTTPSOptions::CERT_OK), FilePath(kDocRoot)), |
27 FilePath(kDocRoot)), | 29 https_server_expired_( |
| 30 HTTPSOptions(HTTPSOptions::CERT_EXPIRED), FilePath(kDocRoot)), |
28 https_server_mismatched_( | 31 https_server_mismatched_( |
29 net::TestServer::TYPE_HTTPS_MISMATCHED_HOSTNAME, | 32 HTTPSOptions(HTTPSOptions::CERT_MISMATCHED_NAME), |
30 FilePath(kDocRoot)) { | 33 FilePath(kDocRoot)) { |
31 EnableDOMAutomation(); | 34 EnableDOMAutomation(); |
32 } | 35 } |
33 | 36 |
34 void CheckAuthenticatedState(TabContents* tab, | 37 void CheckAuthenticatedState(TabContents* tab, |
35 bool displayed_insecure_content) { | 38 bool displayed_insecure_content) { |
36 NavigationEntry* entry = tab->controller().GetActiveEntry(); | 39 NavigationEntry* entry = tab->controller().GetActiveEntry(); |
37 ASSERT_TRUE(entry); | 40 ASSERT_TRUE(entry); |
38 EXPECT_EQ(NavigationEntry::NORMAL_PAGE, entry->page_type()); | 41 EXPECT_EQ(NavigationEntry::NORMAL_PAGE, entry->page_type()); |
39 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATED, entry->ssl().security_style()); | 42 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATED, entry->ssl().security_style()); |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 | 951 |
949 // Visit a page over https that contains a frame with a redirect. | 952 // Visit a page over https that contains a frame with a redirect. |
950 | 953 |
951 // XMLHttpRequest insecure content in synchronous mode. | 954 // XMLHttpRequest insecure content in synchronous mode. |
952 | 955 |
953 // XMLHttpRequest insecure content in asynchronous mode. | 956 // XMLHttpRequest insecure content in asynchronous mode. |
954 | 957 |
955 // XMLHttpRequest over bad ssl in synchronous mode. | 958 // XMLHttpRequest over bad ssl in synchronous mode. |
956 | 959 |
957 // XMLHttpRequest over OK ssl in synchronous mode. | 960 // XMLHttpRequest over OK ssl in synchronous mode. |
OLD | NEW |