| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 | 1186 |
| 1187 // Test page runs a WebSocket wss connection test. The result will be shown | 1187 // Test page runs a WebSocket wss connection test. The result will be shown |
| 1188 // as page title. | 1188 // as page title. |
| 1189 const base::string16 result = watcher.WaitAndGetTitle(); | 1189 const base::string16 result = watcher.WaitAndGetTitle(); |
| 1190 EXPECT_TRUE(base::LowerCaseEqualsASCII(result, "pass")); | 1190 EXPECT_TRUE(base::LowerCaseEqualsASCII(result, "pass")); |
| 1191 } | 1191 } |
| 1192 #endif // defined(USE_NSS_CERTS) | 1192 #endif // defined(USE_NSS_CERTS) |
| 1193 | 1193 |
| 1194 // Flaky on CrOS http://crbug.com/92292 | 1194 // Flaky on CrOS http://crbug.com/92292 |
| 1195 #if defined(OS_CHROMEOS) | 1195 #if defined(OS_CHROMEOS) |
| 1196 #define MAYBE_TestHTTPSErrorWithNoNavEntry \ | 1196 #define MAYBE_TestHTTPSErrorOnInitialNavigation \ |
| 1197 DISABLED_TestHTTPSErrorWithNoNavEntry | 1197 DISABLED_TestHTTPSErrorOnInitialNavigation |
| 1198 #else | 1198 #else |
| 1199 #define MAYBE_TestHTTPSErrorWithNoNavEntry TestHTTPSErrorWithNoNavEntry | 1199 #define MAYBE_TestHTTPSErrorOnInitialNavigation \ |
| 1200 TestHTTPSErrorOnInitialNavigation |
| 1200 #endif // defined(OS_CHROMEOS) | 1201 #endif // defined(OS_CHROMEOS) |
| 1201 | 1202 |
| 1202 // Open a page with a HTTPS error in a tab with no prior navigation (through a | 1203 // Open a page with a HTTPS error in a tab with no prior navigation (through a |
| 1203 // link with a blank target). This is to test that the lack of navigation entry | 1204 // link with a blank target). This used to test for a case where we had no |
| 1204 // does not cause any problems (it was causing a crasher, see | 1205 // NavigationEntry (for https://crbug.com/19941), but now it verifies the |
| 1205 // http://crbug.com/19941). | 1206 // behavior for the initial NavigationEntry. |
| 1206 IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestHTTPSErrorWithNoNavEntry) { | 1207 IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestHTTPSErrorOnInitialNavigation) { |
| 1207 ASSERT_TRUE(https_server_expired_.Start()); | 1208 ASSERT_TRUE(https_server_expired_.Start()); |
| 1208 | 1209 |
| 1209 GURL url = https_server_expired_.GetURL("files/ssl/google.htm"); | 1210 GURL url = https_server_expired_.GetURL("files/ssl/google.htm"); |
| 1210 WebContents* tab2 = chrome::AddSelectedTabWithURL( | 1211 WebContents* tab2 = chrome::AddSelectedTabWithURL( |
| 1211 browser(), url, ui::PAGE_TRANSITION_TYPED); | 1212 browser(), url, ui::PAGE_TRANSITION_TYPED); |
| 1212 content::WaitForLoadStop(tab2); | 1213 content::WaitForLoadStop(tab2); |
| 1213 | 1214 |
| 1214 // Verify our assumption that there was no prior navigation. | 1215 // Verify our assumption that there was no prior navigation. We can still go |
| 1215 EXPECT_FALSE(chrome::CanGoBack(browser())); | 1216 // back to the initial (possibly modified) page, since the interstitial is |
| 1217 // just an overlay. |
| 1218 EXPECT_TRUE(tab2->GetController().IsInitialNavigation()); |
| 1219 EXPECT_TRUE(chrome::CanGoBack(browser())); |
| 1216 | 1220 |
| 1217 // We should have an interstitial page showing. | 1221 // We should have an interstitial page showing. |
| 1218 ASSERT_TRUE(tab2->GetInterstitialPage()); | 1222 ASSERT_TRUE(tab2->GetInterstitialPage()); |
| 1219 ASSERT_EQ(SSLBlockingPage::kTypeForTesting, tab2->GetInterstitialPage() | 1223 ASSERT_EQ(SSLBlockingPage::kTypeForTesting, tab2->GetInterstitialPage() |
| 1220 ->GetDelegateForTesting() | 1224 ->GetDelegateForTesting() |
| 1221 ->GetTypeForTesting()); | 1225 ->GetTypeForTesting()); |
| 1222 } | 1226 } |
| 1223 | 1227 |
| 1224 IN_PROC_BROWSER_TEST_F(SSLUITest, TestBadHTTPSDownload) { | 1228 IN_PROC_BROWSER_TEST_F(SSLUITest, TestBadHTTPSDownload) { |
| 1225 ASSERT_TRUE(test_server()->Start()); | 1229 ASSERT_TRUE(test_server()->Start()); |
| (...skipping 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2907 | 2911 |
| 2908 // Visit a page over https that contains a frame with a redirect. | 2912 // Visit a page over https that contains a frame with a redirect. |
| 2909 | 2913 |
| 2910 // XMLHttpRequest insecure content in synchronous mode. | 2914 // XMLHttpRequest insecure content in synchronous mode. |
| 2911 | 2915 |
| 2912 // XMLHttpRequest insecure content in asynchronous mode. | 2916 // XMLHttpRequest insecure content in asynchronous mode. |
| 2913 | 2917 |
| 2914 // XMLHttpRequest over bad ssl in synchronous mode. | 2918 // XMLHttpRequest over bad ssl in synchronous mode. |
| 2915 | 2919 |
| 2916 // XMLHttpRequest over OK ssl in synchronous mode. | 2920 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |