OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser/browser.h" | 6 #include "chrome/browser/browser.h" |
7 #include "chrome/browser/pref_service.h" | 7 #include "chrome/browser/pref_service.h" |
8 #include "chrome/browser/profile.h" | 8 #include "chrome/browser/profile.h" |
9 #include "chrome/browser/tab_contents/interstitial_page.h" | 9 #include "chrome/browser/tab_contents/interstitial_page.h" |
10 #include "chrome/browser/tab_contents/navigation_entry.h" | 10 #include "chrome/browser/tab_contents/navigation_entry.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 true); // Interstitial showing | 166 true); // Interstitial showing |
167 | 167 |
168 ProceedThroughInterstitial(tab); | 168 ProceedThroughInterstitial(tab); |
169 | 169 |
170 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, | 170 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, |
171 false); // No interstitial showing | 171 false); // No interstitial showing |
172 } | 172 } |
173 | 173 |
174 // Visits a page with https error and don't proceed (and ensure we can still | 174 // Visits a page with https error and don't proceed (and ensure we can still |
175 // navigate at that point): | 175 // navigate at that point): |
176 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSExpiredCertAndDontProceed) { | 176 // Marked as flaky, see bug 40932. |
| 177 IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestHTTPSExpiredCertAndDontProceed) { |
177 scoped_refptr<HTTPTestServer> http_server = PlainServer(); | 178 scoped_refptr<HTTPTestServer> http_server = PlainServer(); |
178 ASSERT_TRUE(http_server.get() != NULL); | 179 ASSERT_TRUE(http_server.get() != NULL); |
179 scoped_refptr<HTTPSTestServer> good_https_server = GoodCertServer(); | 180 scoped_refptr<HTTPSTestServer> good_https_server = GoodCertServer(); |
180 ASSERT_TRUE(good_https_server.get() != NULL); | 181 ASSERT_TRUE(good_https_server.get() != NULL); |
181 scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); | 182 scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); |
182 ASSERT_TRUE(bad_https_server.get() != NULL); | 183 ASSERT_TRUE(bad_https_server.get() != NULL); |
183 | 184 |
184 // First navigate to an OK page. | 185 // First navigate to an OK page. |
185 ui_test_utils::NavigateToURL(browser(), good_https_server->TestServerPageW( | 186 ui_test_utils::NavigateToURL(browser(), good_https_server->TestServerPageW( |
186 L"files/ssl/google.html")); | 187 L"files/ssl/google.html")); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 272 |
272 // Simulate user clicking and holding on back button (crbug.com/37215). | 273 // Simulate user clicking and holding on back button (crbug.com/37215). |
273 tab->controller().GoToOffset(-1); | 274 tab->controller().GoToOffset(-1); |
274 | 275 |
275 // We should be back at the original good page. | 276 // We should be back at the original good page. |
276 EXPECT_FALSE(browser()->GetSelectedTabContents()->interstitial_page()); | 277 EXPECT_FALSE(browser()->GetSelectedTabContents()->interstitial_page()); |
277 CheckUnauthenticatedState(tab); | 278 CheckUnauthenticatedState(tab); |
278 } | 279 } |
279 | 280 |
280 // Visits a page with https error and then goes forward using GoToOffset. | 281 // Visits a page with https error and then goes forward using GoToOffset. |
281 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSExpiredCertAndGoForward) { | 282 // Marked as flaky, see bug 40932. |
| 283 IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestHTTPSExpiredCertAndGoForward) { |
282 scoped_refptr<HTTPTestServer> http_server = PlainServer(); | 284 scoped_refptr<HTTPTestServer> http_server = PlainServer(); |
283 ASSERT_TRUE(http_server.get() != NULL); | 285 ASSERT_TRUE(http_server.get() != NULL); |
284 scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); | 286 scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); |
285 ASSERT_TRUE(bad_https_server.get() != NULL); | 287 ASSERT_TRUE(bad_https_server.get() != NULL); |
286 | 288 |
287 // First navigate to two HTTP pages. | 289 // First navigate to two HTTP pages. |
288 ui_test_utils::NavigateToURL(browser(), http_server->TestServerPageW( | 290 ui_test_utils::NavigateToURL(browser(), http_server->TestServerPageW( |
289 L"files/ssl/google.html")); | 291 L"files/ssl/google.html")); |
290 TabContents* tab = browser()->GetSelectedTabContents(); | 292 TabContents* tab = browser()->GetSelectedTabContents(); |
291 NavigationEntry* entry1 = tab->controller().GetActiveEntry(); | 293 NavigationEntry* entry1 = tab->controller().GetActiveEntry(); |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 // BadCertServer. | 928 // BadCertServer. |
927 ui_test_utils::NavigateToURL(browser(), good_https_server->TestServerPage( | 929 ui_test_utils::NavigateToURL(browser(), good_https_server->TestServerPage( |
928 "files/ssl/page_with_unsafe_worker.html")); | 930 "files/ssl/page_with_unsafe_worker.html")); |
929 TabContents* tab = browser()->GetSelectedTabContents(); | 931 TabContents* tab = browser()->GetSelectedTabContents(); |
930 // Expect Worker not to load mixed content. | 932 // Expect Worker not to load mixed content. |
931 CheckWorkerLoadResult(tab, false); | 933 CheckWorkerLoadResult(tab, false); |
932 // The bad content is filtered, expect the state to be authenticated. | 934 // The bad content is filtered, expect the state to be authenticated. |
933 CheckAuthenticatedState(tab, false, false); | 935 CheckAuthenticatedState(tab, false, false); |
934 } | 936 } |
935 | 937 |
936 IN_PROC_BROWSER_TEST_F(SSLUITest, TestUnsafeContentsInWorker) { | 938 // Marked as flaky, see bug 40932. |
| 939 IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestUnsafeContentsInWorker) { |
937 scoped_refptr<HTTPSTestServer> good_https_server = GoodCertServer(); | 940 scoped_refptr<HTTPSTestServer> good_https_server = GoodCertServer(); |
938 ASSERT_TRUE(good_https_server.get() != NULL); | 941 ASSERT_TRUE(good_https_server.get() != NULL); |
939 scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); | 942 scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); |
940 ASSERT_TRUE(bad_https_server.get() != NULL); | 943 ASSERT_TRUE(bad_https_server.get() != NULL); |
941 | 944 |
942 // Navigate to an unsafe site. Proceed with interstitial page to indicate | 945 // Navigate to an unsafe site. Proceed with interstitial page to indicate |
943 // the user approves the bad certificate. | 946 // the user approves the bad certificate. |
944 ui_test_utils::NavigateToURL(browser(), bad_https_server->TestServerPage( | 947 ui_test_utils::NavigateToURL(browser(), bad_https_server->TestServerPage( |
945 "files/ssl/blank_page.html")); | 948 "files/ssl/blank_page.html")); |
946 TabContents* tab = browser()->GetSelectedTabContents(); | 949 TabContents* tab = browser()->GetSelectedTabContents(); |
(...skipping 15 matching lines...) Expand all Loading... |
962 | 965 |
963 // Visit a page over https that contains a frame with a redirect. | 966 // Visit a page over https that contains a frame with a redirect. |
964 | 967 |
965 // XMLHttpRequest mixed in synchronous mode. | 968 // XMLHttpRequest mixed in synchronous mode. |
966 | 969 |
967 // XMLHttpRequest mixed in asynchronous mode. | 970 // XMLHttpRequest mixed in asynchronous mode. |
968 | 971 |
969 // XMLHttpRequest over bad ssl in synchronous mode. | 972 // XMLHttpRequest over bad ssl in synchronous mode. |
970 | 973 |
971 // XMLHttpRequest over OK ssl in synchronous mode. | 974 // XMLHttpRequest over OK ssl in synchronous mode. |
OLD | NEW |