| 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/stringprintf.h" | 5 #include "base/stringprintf.h" |
| 6 #include "base/time.h" | 6 #include "base/time.h" |
| 7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
| 9 #include "chrome/browser/browser_navigator.h" | 9 #include "chrome/browser/browser_navigator.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 https_server_mismatched_( | 33 https_server_mismatched_( |
| 34 HTTPSOptions(HTTPSOptions::CERT_MISMATCHED_NAME), | 34 HTTPSOptions(HTTPSOptions::CERT_MISMATCHED_NAME), |
| 35 FilePath(kDocRoot)) { | 35 FilePath(kDocRoot)) { |
| 36 EnableDOMAutomation(); | 36 EnableDOMAutomation(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void CheckAuthenticatedState(TabContents* tab, | 39 void CheckAuthenticatedState(TabContents* tab, |
| 40 bool displayed_insecure_content) { | 40 bool displayed_insecure_content) { |
| 41 NavigationEntry* entry = tab->controller().GetActiveEntry(); | 41 NavigationEntry* entry = tab->controller().GetActiveEntry(); |
| 42 ASSERT_TRUE(entry); | 42 ASSERT_TRUE(entry); |
| 43 EXPECT_EQ(NavigationEntry::NORMAL_PAGE, entry->page_type()); | 43 EXPECT_EQ(NORMAL_PAGE, entry->page_type()); |
| 44 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATED, entry->ssl().security_style()); | 44 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATED, entry->ssl().security_style()); |
| 45 EXPECT_EQ(0, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); | 45 EXPECT_EQ(0, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); |
| 46 EXPECT_EQ(displayed_insecure_content, | 46 EXPECT_EQ(displayed_insecure_content, |
| 47 entry->ssl().displayed_insecure_content()); | 47 entry->ssl().displayed_insecure_content()); |
| 48 EXPECT_FALSE(entry->ssl().ran_insecure_content()); | 48 EXPECT_FALSE(entry->ssl().ran_insecure_content()); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void CheckUnauthenticatedState(TabContents* tab) { | 51 void CheckUnauthenticatedState(TabContents* tab) { |
| 52 NavigationEntry* entry = tab->controller().GetActiveEntry(); | 52 NavigationEntry* entry = tab->controller().GetActiveEntry(); |
| 53 ASSERT_TRUE(entry); | 53 ASSERT_TRUE(entry); |
| 54 EXPECT_EQ(NavigationEntry::NORMAL_PAGE, entry->page_type()); | 54 EXPECT_EQ(NORMAL_PAGE, entry->page_type()); |
| 55 EXPECT_EQ(SECURITY_STYLE_UNAUTHENTICATED, entry->ssl().security_style()); | 55 EXPECT_EQ(SECURITY_STYLE_UNAUTHENTICATED, entry->ssl().security_style()); |
| 56 EXPECT_EQ(0, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); | 56 EXPECT_EQ(0, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); |
| 57 EXPECT_FALSE(entry->ssl().displayed_insecure_content()); | 57 EXPECT_FALSE(entry->ssl().displayed_insecure_content()); |
| 58 EXPECT_FALSE(entry->ssl().ran_insecure_content()); | 58 EXPECT_FALSE(entry->ssl().ran_insecure_content()); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void CheckAuthenticationBrokenState(TabContents* tab, | 61 void CheckAuthenticationBrokenState(TabContents* tab, |
| 62 int error, | 62 int error, |
| 63 bool ran_insecure_content, | 63 bool ran_insecure_content, |
| 64 bool interstitial) { | 64 bool interstitial) { |
| 65 NavigationEntry* entry = tab->controller().GetActiveEntry(); | 65 NavigationEntry* entry = tab->controller().GetActiveEntry(); |
| 66 ASSERT_TRUE(entry); | 66 ASSERT_TRUE(entry); |
| 67 EXPECT_EQ(interstitial ? NavigationEntry::INTERSTITIAL_PAGE : | 67 EXPECT_EQ(interstitial ? INTERSTITIAL_PAGE : NORMAL_PAGE, |
| 68 NavigationEntry::NORMAL_PAGE, | |
| 69 entry->page_type()); | 68 entry->page_type()); |
| 70 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, | 69 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, |
| 71 entry->ssl().security_style()); | 70 entry->ssl().security_style()); |
| 72 // CERT_STATUS_UNABLE_TO_CHECK_REVOCATION doesn't lower the security style | 71 // CERT_STATUS_UNABLE_TO_CHECK_REVOCATION doesn't lower the security style |
| 73 // to SECURITY_STYLE_AUTHENTICATION_BROKEN. | 72 // to SECURITY_STYLE_AUTHENTICATION_BROKEN. |
| 74 ASSERT_NE(net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION, error); | 73 ASSERT_NE(net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION, error); |
| 75 EXPECT_EQ(error, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); | 74 EXPECT_EQ(error, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); |
| 76 EXPECT_FALSE(entry->ssl().displayed_insecure_content()); | 75 EXPECT_FALSE(entry->ssl().displayed_insecure_content()); |
| 77 EXPECT_EQ(ran_insecure_content, entry->ssl().ran_insecure_content()); | 76 EXPECT_EQ(ran_insecure_content, entry->ssl().ran_insecure_content()); |
| 78 } | 77 } |
| (...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 | 1011 |
| 1013 // Visit a page over https that contains a frame with a redirect. | 1012 // Visit a page over https that contains a frame with a redirect. |
| 1014 | 1013 |
| 1015 // XMLHttpRequest insecure content in synchronous mode. | 1014 // XMLHttpRequest insecure content in synchronous mode. |
| 1016 | 1015 |
| 1017 // XMLHttpRequest insecure content in asynchronous mode. | 1016 // XMLHttpRequest insecure content in asynchronous mode. |
| 1018 | 1017 |
| 1019 // XMLHttpRequest over bad ssl in synchronous mode. | 1018 // XMLHttpRequest over bad ssl in synchronous mode. |
| 1020 | 1019 |
| 1021 // XMLHttpRequest over OK ssl in synchronous mode. | 1020 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |