| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 5 #include "base/command_line.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/tabs/tab_strip_model.h" | 8 #include "chrome/browser/tabs/tab_strip_model.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_navigator.h" | 10 #include "chrome/browser/ui/browser_navigator.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 virtual void SetUpCommandLine(CommandLine* command_line) { | 42 virtual void SetUpCommandLine(CommandLine* command_line) { |
| 43 command_line->AppendSwitch(switches::kAllowRunningInsecureContent); | 43 command_line->AppendSwitch(switches::kAllowRunningInsecureContent); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void CheckAuthenticatedState(TabContents* tab, | 46 void CheckAuthenticatedState(TabContents* tab, |
| 47 bool displayed_insecure_content) { | 47 bool displayed_insecure_content) { |
| 48 NavigationEntry* entry = tab->controller().GetActiveEntry(); | 48 NavigationEntry* entry = tab->controller().GetActiveEntry(); |
| 49 ASSERT_TRUE(entry); | 49 ASSERT_TRUE(entry); |
| 50 EXPECT_EQ(NORMAL_PAGE, entry->page_type()); | 50 EXPECT_EQ(NORMAL_PAGE, entry->page_type()); |
| 51 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATED, entry->ssl().security_style()); | 51 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATED, entry->ssl().security_style()); |
| 52 EXPECT_EQ(0, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); | 52 EXPECT_EQ(0U, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); |
| 53 EXPECT_EQ(displayed_insecure_content, | 53 EXPECT_EQ(displayed_insecure_content, |
| 54 entry->ssl().displayed_insecure_content()); | 54 entry->ssl().displayed_insecure_content()); |
| 55 EXPECT_FALSE(entry->ssl().ran_insecure_content()); | 55 EXPECT_FALSE(entry->ssl().ran_insecure_content()); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void CheckUnauthenticatedState(TabContents* tab) { | 58 void CheckUnauthenticatedState(TabContents* tab) { |
| 59 NavigationEntry* entry = tab->controller().GetActiveEntry(); | 59 NavigationEntry* entry = tab->controller().GetActiveEntry(); |
| 60 ASSERT_TRUE(entry); | 60 ASSERT_TRUE(entry); |
| 61 EXPECT_EQ(NORMAL_PAGE, entry->page_type()); | 61 EXPECT_EQ(NORMAL_PAGE, entry->page_type()); |
| 62 EXPECT_EQ(SECURITY_STYLE_UNAUTHENTICATED, entry->ssl().security_style()); | 62 EXPECT_EQ(SECURITY_STYLE_UNAUTHENTICATED, entry->ssl().security_style()); |
| 63 EXPECT_EQ(0, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); | 63 EXPECT_EQ(0U, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); |
| 64 EXPECT_FALSE(entry->ssl().displayed_insecure_content()); | 64 EXPECT_FALSE(entry->ssl().displayed_insecure_content()); |
| 65 EXPECT_FALSE(entry->ssl().ran_insecure_content()); | 65 EXPECT_FALSE(entry->ssl().ran_insecure_content()); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void CheckAuthenticationBrokenState(TabContents* tab, | 68 void CheckAuthenticationBrokenState(TabContents* tab, |
| 69 int error, | 69 net::CertStatus error, |
| 70 bool ran_insecure_content, | 70 bool ran_insecure_content, |
| 71 bool interstitial) { | 71 bool interstitial) { |
| 72 NavigationEntry* entry = tab->controller().GetActiveEntry(); | 72 NavigationEntry* entry = tab->controller().GetActiveEntry(); |
| 73 ASSERT_TRUE(entry); | 73 ASSERT_TRUE(entry); |
| 74 EXPECT_EQ(interstitial ? INTERSTITIAL_PAGE : NORMAL_PAGE, | 74 EXPECT_EQ(interstitial ? INTERSTITIAL_PAGE : NORMAL_PAGE, |
| 75 entry->page_type()); | 75 entry->page_type()); |
| 76 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, | 76 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, |
| 77 entry->ssl().security_style()); | 77 entry->ssl().security_style()); |
| 78 // CERT_STATUS_UNABLE_TO_CHECK_REVOCATION doesn't lower the security style | 78 // CERT_STATUS_UNABLE_TO_CHECK_REVOCATION doesn't lower the security style |
| 79 // to SECURITY_STYLE_AUTHENTICATION_BROKEN. | 79 // to SECURITY_STYLE_AUTHENTICATION_BROKEN. |
| (...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 | 1285 |
| 1286 // Visit a page over https that contains a frame with a redirect. | 1286 // Visit a page over https that contains a frame with a redirect. |
| 1287 | 1287 |
| 1288 // XMLHttpRequest insecure content in synchronous mode. | 1288 // XMLHttpRequest insecure content in synchronous mode. |
| 1289 | 1289 |
| 1290 // XMLHttpRequest insecure content in asynchronous mode. | 1290 // XMLHttpRequest insecure content in asynchronous mode. |
| 1291 | 1291 |
| 1292 // XMLHttpRequest over bad ssl in synchronous mode. | 1292 // XMLHttpRequest over bad ssl in synchronous mode. |
| 1293 | 1293 |
| 1294 // XMLHttpRequest over OK ssl in synchronous mode. | 1294 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |