| 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" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 https_server_mismatched_( | 31 https_server_mismatched_( |
| 32 HTTPSOptions(HTTPSOptions::CERT_MISMATCHED_NAME), | 32 HTTPSOptions(HTTPSOptions::CERT_MISMATCHED_NAME), |
| 33 FilePath(kDocRoot)) { | 33 FilePath(kDocRoot)) { |
| 34 EnableDOMAutomation(); | 34 EnableDOMAutomation(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void CheckAuthenticatedState(TabContents* tab, | 37 void CheckAuthenticatedState(TabContents* tab, |
| 38 bool displayed_insecure_content) { | 38 bool displayed_insecure_content) { |
| 39 NavigationEntry* entry = tab->controller().GetActiveEntry(); | 39 NavigationEntry* entry = tab->controller().GetActiveEntry(); |
| 40 ASSERT_TRUE(entry); | 40 ASSERT_TRUE(entry); |
| 41 EXPECT_EQ(NavigationEntry::NORMAL_PAGE, entry->page_type()); | 41 EXPECT_EQ(NORMAL_PAGE, entry->page_type()); |
| 42 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATED, entry->ssl().security_style()); | 42 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATED, entry->ssl().security_style()); |
| 43 EXPECT_EQ(0, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); | 43 EXPECT_EQ(0, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); |
| 44 EXPECT_EQ(displayed_insecure_content, | 44 EXPECT_EQ(displayed_insecure_content, |
| 45 entry->ssl().displayed_insecure_content()); | 45 entry->ssl().displayed_insecure_content()); |
| 46 EXPECT_FALSE(entry->ssl().ran_insecure_content()); | 46 EXPECT_FALSE(entry->ssl().ran_insecure_content()); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void CheckUnauthenticatedState(TabContents* tab) { | 49 void CheckUnauthenticatedState(TabContents* tab) { |
| 50 NavigationEntry* entry = tab->controller().GetActiveEntry(); | 50 NavigationEntry* entry = tab->controller().GetActiveEntry(); |
| 51 ASSERT_TRUE(entry); | 51 ASSERT_TRUE(entry); |
| 52 EXPECT_EQ(NavigationEntry::NORMAL_PAGE, entry->page_type()); | 52 EXPECT_EQ(NORMAL_PAGE, entry->page_type()); |
| 53 EXPECT_EQ(SECURITY_STYLE_UNAUTHENTICATED, entry->ssl().security_style()); | 53 EXPECT_EQ(SECURITY_STYLE_UNAUTHENTICATED, entry->ssl().security_style()); |
| 54 EXPECT_EQ(0, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); | 54 EXPECT_EQ(0, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); |
| 55 EXPECT_FALSE(entry->ssl().displayed_insecure_content()); | 55 EXPECT_FALSE(entry->ssl().displayed_insecure_content()); |
| 56 EXPECT_FALSE(entry->ssl().ran_insecure_content()); | 56 EXPECT_FALSE(entry->ssl().ran_insecure_content()); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void CheckAuthenticationBrokenState(TabContents* tab, | 59 void CheckAuthenticationBrokenState(TabContents* tab, |
| 60 int error, | 60 int error, |
| 61 bool ran_insecure_content, | 61 bool ran_insecure_content, |
| 62 bool interstitial) { | 62 bool interstitial) { |
| 63 NavigationEntry* entry = tab->controller().GetActiveEntry(); | 63 NavigationEntry* entry = tab->controller().GetActiveEntry(); |
| 64 ASSERT_TRUE(entry); | 64 ASSERT_TRUE(entry); |
| 65 EXPECT_EQ(interstitial ? NavigationEntry::INTERSTITIAL_PAGE : | 65 EXPECT_EQ(interstitial ? INTERSTITIAL_PAGE : NORMAL_PAGE, |
| 66 NavigationEntry::NORMAL_PAGE, | |
| 67 entry->page_type()); | 66 entry->page_type()); |
| 68 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, | 67 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, |
| 69 entry->ssl().security_style()); | 68 entry->ssl().security_style()); |
| 70 // CERT_STATUS_UNABLE_TO_CHECK_REVOCATION doesn't lower the security style | 69 // CERT_STATUS_UNABLE_TO_CHECK_REVOCATION doesn't lower the security style |
| 71 // to SECURITY_STYLE_AUTHENTICATION_BROKEN. | 70 // to SECURITY_STYLE_AUTHENTICATION_BROKEN. |
| 72 ASSERT_NE(net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION, error); | 71 ASSERT_NE(net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION, error); |
| 73 EXPECT_EQ(error, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); | 72 EXPECT_EQ(error, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); |
| 74 EXPECT_FALSE(entry->ssl().displayed_insecure_content()); | 73 EXPECT_FALSE(entry->ssl().displayed_insecure_content()); |
| 75 EXPECT_EQ(ran_insecure_content, entry->ssl().ran_insecure_content()); | 74 EXPECT_EQ(ran_insecure_content, entry->ssl().ran_insecure_content()); |
| 76 } | 75 } |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 | 950 |
| 952 // Visit a page over https that contains a frame with a redirect. | 951 // Visit a page over https that contains a frame with a redirect. |
| 953 | 952 |
| 954 // XMLHttpRequest insecure content in synchronous mode. | 953 // XMLHttpRequest insecure content in synchronous mode. |
| 955 | 954 |
| 956 // XMLHttpRequest insecure content in asynchronous mode. | 955 // XMLHttpRequest insecure content in asynchronous mode. |
| 957 | 956 |
| 958 // XMLHttpRequest over bad ssl in synchronous mode. | 957 // XMLHttpRequest over bad ssl in synchronous mode. |
| 959 | 958 |
| 960 // XMLHttpRequest over OK ssl in synchronous mode. | 959 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |