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/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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 ASSERT_TRUE(entry); | 92 ASSERT_TRUE(entry); |
93 EXPECT_EQ(interstitial ? | 93 EXPECT_EQ(interstitial ? |
94 content::PAGE_TYPE_INTERSTITIAL : content::PAGE_TYPE_NORMAL, | 94 content::PAGE_TYPE_INTERSTITIAL : content::PAGE_TYPE_NORMAL, |
95 entry->GetPageType()); | 95 entry->GetPageType()); |
96 EXPECT_EQ(content::SECURITY_STYLE_AUTHENTICATION_BROKEN, | 96 EXPECT_EQ(content::SECURITY_STYLE_AUTHENTICATION_BROKEN, |
97 entry->GetSSL().security_style); | 97 entry->GetSSL().security_style); |
98 // CERT_STATUS_UNABLE_TO_CHECK_REVOCATION doesn't lower the security style | 98 // CERT_STATUS_UNABLE_TO_CHECK_REVOCATION doesn't lower the security style |
99 // to SECURITY_STYLE_AUTHENTICATION_BROKEN. | 99 // to SECURITY_STYLE_AUTHENTICATION_BROKEN. |
100 ASSERT_NE(net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION, error); | 100 ASSERT_NE(net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION, error); |
101 EXPECT_EQ(error, | 101 EXPECT_EQ(error, |
102 error & | |
102 entry->GetSSL().cert_status & net::CERT_STATUS_ALL_ERRORS); | 103 entry->GetSSL().cert_status & net::CERT_STATUS_ALL_ERRORS); |
wtc
2012/02/17 00:14:07
If you want to allow extraneous certificate errors
tpayne
2012/02/17 19:25:47
Done.
| |
103 EXPECT_FALSE(!!(entry->GetSSL().content_status & | 104 EXPECT_FALSE(!!(entry->GetSSL().content_status & |
104 SSLStatus::DISPLAYED_INSECURE_CONTENT)); | 105 SSLStatus::DISPLAYED_INSECURE_CONTENT)); |
105 EXPECT_EQ(ran_insecure_content, | 106 EXPECT_EQ(ran_insecure_content, |
106 !!(entry->GetSSL().content_status & SSLStatus::RAN_INSECURE_CONTENT)); | 107 !!(entry->GetSSL().content_status & SSLStatus::RAN_INSECURE_CONTENT)); |
108 unsigned int extra_cert_errors = error ^ (entry->GetSSL().cert_status & | |
wtc
2012/02/17 00:14:07
Nit: it looks nicer to use net::CertStatus instead
tpayne
2012/02/17 19:25:47
Done.
| |
109 net::CERT_STATUS_ALL_ERRORS); | |
110 if (extra_cert_errors) { | |
111 LOG(WARNING) << "Got unexpected cert error: " << extra_cert_errors; | |
112 } | |
wtc
2012/02/17 00:14:07
Nit: this file seems to omit curly braces for one-
tpayne
2012/02/17 19:25:47
Done.
| |
107 } | 113 } |
108 | 114 |
109 void CheckWorkerLoadResult(WebContents* tab, bool expectLoaded) { | 115 void CheckWorkerLoadResult(WebContents* tab, bool expectLoaded) { |
110 // Workers are async and we don't have notifications for them passing | 116 // Workers are async and we don't have notifications for them passing |
111 // messages since they do it between renderer and worker processes. | 117 // messages since they do it between renderer and worker processes. |
112 // So have a polling loop, check every 200ms, timeout at 30s. | 118 // So have a polling loop, check every 200ms, timeout at 30s. |
113 const int timeout_ms = 200; | 119 const int timeout_ms = 200; |
114 base::Time timeToQuit = base::Time::Now() + | 120 base::Time timeToQuit = base::Time::Now() + |
115 base::TimeDelta::FromMilliseconds(30000); | 121 base::TimeDelta::FromMilliseconds(30000); |
116 | 122 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
307 true); // Interstitial showing | 313 true); // Interstitial showing |
308 | 314 |
309 ProceedThroughInterstitial(tab); | 315 ProceedThroughInterstitial(tab); |
310 | 316 |
311 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, | 317 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
312 false); // No interstitial showing | 318 false); // No interstitial showing |
313 } | 319 } |
314 | 320 |
315 // Visits a page with https error and don't proceed (and ensure we can still | 321 // Visits a page with https error and don't proceed (and ensure we can still |
316 // navigate at that point): | 322 // navigate at that point): |
317 // Disabled, flakily exceeds test timeout, http://crbug.com/43575. | 323 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSExpiredCertAndDontProceed) { |
318 // Marked as flaky, see bug 40932. | |
319 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestHTTPSExpiredCertAndDontProceed) { | |
320 ASSERT_TRUE(test_server()->Start()); | 324 ASSERT_TRUE(test_server()->Start()); |
321 ASSERT_TRUE(https_server_.Start()); | 325 ASSERT_TRUE(https_server_.Start()); |
322 ASSERT_TRUE(https_server_expired_.Start()); | 326 ASSERT_TRUE(https_server_expired_.Start()); |
323 | 327 |
324 // First navigate to an OK page. | 328 // First navigate to an OK page. |
325 ui_test_utils::NavigateToURL(browser(), | 329 ui_test_utils::NavigateToURL(browser(), |
326 https_server_.GetURL("files/ssl/google.html")); | 330 https_server_.GetURL("files/ssl/google.html")); |
327 | 331 |
328 WebContents* tab = browser()->GetSelectedWebContents(); | 332 WebContents* tab = browser()->GetSelectedWebContents(); |
329 NavigationEntry* entry = tab->GetController().GetActiveEntry(); | 333 NavigationEntry* entry = tab->GetController().GetActiveEntry(); |
(...skipping 24 matching lines...) Expand all Loading... | |
354 // We should be back to the original good page. | 358 // We should be back to the original good page. |
355 CheckAuthenticatedState(tab, false); | 359 CheckAuthenticatedState(tab, false); |
356 | 360 |
357 // Try to navigate to a new page. (to make sure bug 5800 is fixed). | 361 // Try to navigate to a new page. (to make sure bug 5800 is fixed). |
358 ui_test_utils::NavigateToURL(browser(), | 362 ui_test_utils::NavigateToURL(browser(), |
359 test_server()->GetURL("files/ssl/google.html")); | 363 test_server()->GetURL("files/ssl/google.html")); |
360 CheckUnauthenticatedState(tab); | 364 CheckUnauthenticatedState(tab); |
361 } | 365 } |
362 | 366 |
363 // Visits a page with https error and then goes back using Browser::GoBack. | 367 // Visits a page with https error and then goes back using Browser::GoBack. |
364 // See bug 114185. | 368 // See bug 114185. |
dpapad
2012/02/16 23:48:22
Could you also remove this comment and add the bug
wtc
2012/02/17 00:14:07
I believe we need to keep the "See bug 114185." co
tpayne
2012/02/17 19:25:47
I think Demetrios is right. Bug 114185 seems to be
tpayne
2012/02/17 19:25:47
Done.
| |
365 // Marked as flaky, see bug 40932. | |
366 IN_PROC_BROWSER_TEST_F(SSLUITest, | 369 IN_PROC_BROWSER_TEST_F(SSLUITest, |
367 DISABLED_TestHTTPSExpiredCertAndGoBackViaButton) { | 370 TestHTTPSExpiredCertAndGoBackViaButton) { |
368 ASSERT_TRUE(test_server()->Start()); | 371 ASSERT_TRUE(test_server()->Start()); |
369 ASSERT_TRUE(https_server_expired_.Start()); | 372 ASSERT_TRUE(https_server_expired_.Start()); |
370 | 373 |
371 // First navigate to an HTTP page. | 374 // First navigate to an HTTP page. |
372 ui_test_utils::NavigateToURL(browser(), | 375 ui_test_utils::NavigateToURL(browser(), |
373 test_server()->GetURL("files/ssl/google.html")); | 376 test_server()->GetURL("files/ssl/google.html")); |
374 WebContents* tab = browser()->GetSelectedWebContents(); | 377 WebContents* tab = browser()->GetSelectedWebContents(); |
375 NavigationEntry* entry = tab->GetController().GetActiveEntry(); | 378 NavigationEntry* entry = tab->GetController().GetActiveEntry(); |
376 ASSERT_TRUE(entry); | 379 ASSERT_TRUE(entry); |
377 | 380 |
(...skipping 15 matching lines...) Expand all Loading... | |
393 load_failed_observer.Wait(); | 396 load_failed_observer.Wait(); |
394 EXPECT_FALSE(tab->GetRenderViewHost()->is_swapped_out()); | 397 EXPECT_FALSE(tab->GetRenderViewHost()->is_swapped_out()); |
395 | 398 |
396 // We should be back at the original good page. | 399 // We should be back at the original good page. |
397 EXPECT_FALSE(browser()->GetSelectedWebContents()->GetInterstitialPage()); | 400 EXPECT_FALSE(browser()->GetSelectedWebContents()->GetInterstitialPage()); |
398 CheckUnauthenticatedState(tab); | 401 CheckUnauthenticatedState(tab); |
399 } | 402 } |
400 | 403 |
401 // Visits a page with https error and then goes back using GoToOffset. | 404 // Visits a page with https error and then goes back using GoToOffset. |
402 // See bug 114185. | 405 // See bug 114185. |
403 // Marked as flaky, see bug 40932. | |
404 IN_PROC_BROWSER_TEST_F(SSLUITest, | 406 IN_PROC_BROWSER_TEST_F(SSLUITest, |
405 DISABLED_TestHTTPSExpiredCertAndGoBackViaMenu) { | 407 TestHTTPSExpiredCertAndGoBackViaMenu) { |
406 ASSERT_TRUE(test_server()->Start()); | 408 ASSERT_TRUE(test_server()->Start()); |
407 ASSERT_TRUE(https_server_expired_.Start()); | 409 ASSERT_TRUE(https_server_expired_.Start()); |
408 | 410 |
409 // First navigate to an HTTP page. | 411 // First navigate to an HTTP page. |
410 ui_test_utils::NavigateToURL(browser(), | 412 ui_test_utils::NavigateToURL(browser(), |
411 test_server()->GetURL("files/ssl/google.html")); | 413 test_server()->GetURL("files/ssl/google.html")); |
412 WebContents* tab = browser()->GetSelectedWebContents(); | 414 WebContents* tab = browser()->GetSelectedWebContents(); |
413 NavigationEntry* entry = tab->GetController().GetActiveEntry(); | 415 NavigationEntry* entry = tab->GetController().GetActiveEntry(); |
414 ASSERT_TRUE(entry); | 416 ASSERT_TRUE(entry); |
415 | 417 |
416 // Now go to a bad HTTPS page that shows an interstitial. | 418 // Now go to a bad HTTPS page that shows an interstitial. |
417 ui_test_utils::NavigateToURL(browser(), | 419 ui_test_utils::NavigateToURL(browser(), |
418 https_server_expired_.GetURL("files/ssl/google.html")); | 420 https_server_expired_.GetURL("files/ssl/google.html")); |
419 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, | 421 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
420 true); // Interstitial showing | 422 true); // Interstitial showing |
421 | 423 |
422 // Simulate user clicking and holding on back button (crbug.com/37215). | 424 // Simulate user clicking and holding on back button (crbug.com/37215). |
423 tab->GetController().GoToOffset(-1); | 425 tab->GetController().GoToOffset(-1); |
424 | 426 |
425 // We should be back at the original good page. | 427 // We should be back at the original good page. |
426 EXPECT_FALSE(browser()->GetSelectedWebContents()->GetInterstitialPage()); | 428 EXPECT_FALSE(browser()->GetSelectedWebContents()->GetInterstitialPage()); |
427 CheckUnauthenticatedState(tab); | 429 CheckUnauthenticatedState(tab); |
428 } | 430 } |
429 | 431 |
430 // Visits a page with https error and then goes forward using GoToOffset. | 432 // Visits a page with https error and then goes forward using GoToOffset. |
431 // Marked as flaky, see bug 40932. | 433 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSExpiredCertAndGoForward) { |
432 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestHTTPSExpiredCertAndGoForward) { | |
433 ASSERT_TRUE(test_server()->Start()); | 434 ASSERT_TRUE(test_server()->Start()); |
434 ASSERT_TRUE(https_server_expired_.Start()); | 435 ASSERT_TRUE(https_server_expired_.Start()); |
435 | 436 |
436 // First navigate to two HTTP pages. | 437 // First navigate to two HTTP pages. |
437 ui_test_utils::NavigateToURL(browser(), | 438 ui_test_utils::NavigateToURL(browser(), |
438 test_server()->GetURL("files/ssl/google.html")); | 439 test_server()->GetURL("files/ssl/google.html")); |
439 WebContents* tab = browser()->GetSelectedWebContents(); | 440 WebContents* tab = browser()->GetSelectedWebContents(); |
440 NavigationEntry* entry1 = tab->GetController().GetActiveEntry(); | 441 NavigationEntry* entry1 = tab->GetController().GetActiveEntry(); |
441 ASSERT_TRUE(entry1); | 442 ASSERT_TRUE(entry1); |
442 ui_test_utils::NavigateToURL(browser(), | 443 ui_test_utils::NavigateToURL(browser(), |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
584 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( | 585 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( |
585 "files/ssl/page_runs_insecure_content.html")); | 586 "files/ssl/page_runs_insecure_content.html")); |
586 | 587 |
587 CheckAuthenticationBrokenState(browser()->GetSelectedWebContents(), 0, true, | 588 CheckAuthenticationBrokenState(browser()->GetSelectedWebContents(), 0, true, |
588 false); | 589 false); |
589 } | 590 } |
590 | 591 |
591 // Visits a page with unsafe content and make sure that: | 592 // Visits a page with unsafe content and make sure that: |
592 // - frames content is replaced with warning | 593 // - frames content is replaced with warning |
593 // - images and scripts are filtered out entirely | 594 // - images and scripts are filtered out entirely |
594 // Marked as flaky, see bug 40932. | 595 IN_PROC_BROWSER_TEST_F(SSLUITest, TestUnsafeContents) { |
595 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestUnsafeContents) { | |
596 ASSERT_TRUE(https_server_.Start()); | 596 ASSERT_TRUE(https_server_.Start()); |
597 ASSERT_TRUE(https_server_expired_.Start()); | 597 ASSERT_TRUE(https_server_expired_.Start()); |
598 | 598 |
599 std::string replacement_path; | 599 std::string replacement_path; |
600 ASSERT_TRUE(GetFilePathWithHostAndPortReplacement( | 600 ASSERT_TRUE(GetFilePathWithHostAndPortReplacement( |
601 "files/ssl/page_with_unsafe_contents.html", | 601 "files/ssl/page_with_unsafe_contents.html", |
602 https_server_expired_.host_port_pair(), | 602 https_server_expired_.host_port_pair(), |
603 &replacement_path)); | 603 &replacement_path)); |
604 ui_test_utils::NavigateToURL(browser(), | 604 ui_test_utils::NavigateToURL(browser(), |
605 https_server_.GetURL(replacement_path)); | 605 https_server_.GetURL(replacement_path)); |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
929 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, | 929 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
930 true); // Interstitial showing. | 930 true); // Interstitial showing. |
931 | 931 |
932 ProceedThroughInterstitial(tab); | 932 ProceedThroughInterstitial(tab); |
933 | 933 |
934 // We have been redirected to the good page. | 934 // We have been redirected to the good page. |
935 CheckAuthenticatedState(tab, false); | 935 CheckAuthenticatedState(tab, false); |
936 } | 936 } |
937 | 937 |
938 // Visit a page over good https that is a redirect to a page with bad https. | 938 // Visit a page over good https that is a redirect to a page with bad https. |
939 // Marked as flaky, see bug 40932. | 939 IN_PROC_BROWSER_TEST_F(SSLUITest, TestRedirectGoodToBadHTTPS) { |
940 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestRedirectGoodToBadHTTPS) { | |
941 ASSERT_TRUE(https_server_.Start()); | 940 ASSERT_TRUE(https_server_.Start()); |
942 ASSERT_TRUE(https_server_expired_.Start()); | 941 ASSERT_TRUE(https_server_expired_.Start()); |
943 | 942 |
944 GURL url1 = https_server_.GetURL("server-redirect?"); | 943 GURL url1 = https_server_.GetURL("server-redirect?"); |
945 GURL url2 = https_server_expired_.GetURL("files/ssl/google.html"); | 944 GURL url2 = https_server_expired_.GetURL("files/ssl/google.html"); |
946 ui_test_utils::NavigateToURL(browser(), GURL(url1.spec() + url2.spec())); | 945 ui_test_utils::NavigateToURL(browser(), GURL(url1.spec() + url2.spec())); |
947 | 946 |
948 WebContents* tab = browser()->GetSelectedWebContents(); | 947 WebContents* tab = browser()->GetSelectedWebContents(); |
949 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, | 948 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
950 true); // Interstitial showing. | 949 true); // Interstitial showing. |
(...skipping 15 matching lines...) Expand all Loading... | |
966 GURL http_url = test_server()->GetURL("server-redirect?"); | 965 GURL http_url = test_server()->GetURL("server-redirect?"); |
967 GURL good_https_url = | 966 GURL good_https_url = |
968 https_server_.GetURL("files/ssl/google.html"); | 967 https_server_.GetURL("files/ssl/google.html"); |
969 | 968 |
970 ui_test_utils::NavigateToURL(browser(), | 969 ui_test_utils::NavigateToURL(browser(), |
971 GURL(http_url.spec() + good_https_url.spec())); | 970 GURL(http_url.spec() + good_https_url.spec())); |
972 CheckAuthenticatedState(tab, false); | 971 CheckAuthenticatedState(tab, false); |
973 } | 972 } |
974 | 973 |
975 // Visit a page over http that is a redirect to a page with bad HTTPS. | 974 // Visit a page over http that is a redirect to a page with bad HTTPS. |
976 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestRedirectHTTPToBadHTTPS) { | 975 IN_PROC_BROWSER_TEST_F(SSLUITest, TestRedirectHTTPToBadHTTPS) { |
977 ASSERT_TRUE(test_server()->Start()); | 976 ASSERT_TRUE(test_server()->Start()); |
978 ASSERT_TRUE(https_server_expired_.Start()); | 977 ASSERT_TRUE(https_server_expired_.Start()); |
979 | 978 |
980 WebContents* tab = browser()->GetSelectedWebContents(); | 979 WebContents* tab = browser()->GetSelectedWebContents(); |
981 | 980 |
982 GURL http_url = test_server()->GetURL("server-redirect?"); | 981 GURL http_url = test_server()->GetURL("server-redirect?"); |
983 GURL bad_https_url = | 982 GURL bad_https_url = |
984 https_server_expired_.GetURL("files/ssl/google.html"); | 983 https_server_expired_.GetURL("files/ssl/google.html"); |
985 ui_test_utils::NavigateToURL(browser(), | 984 ui_test_utils::NavigateToURL(browser(), |
986 GURL(http_url.spec() + bad_https_url.spec())); | 985 GURL(http_url.spec() + bad_https_url.spec())); |
987 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, | 986 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
988 true); // Interstitial showing. | 987 true); // Interstitial showing. |
989 | 988 |
990 ProceedThroughInterstitial(tab); | 989 ProceedThroughInterstitial(tab); |
991 | 990 |
992 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, | 991 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
993 false); // No interstitial showing. | 992 false); // No interstitial showing. |
994 } | 993 } |
995 | 994 |
996 // Visit a page over https that is a redirect to a page with http (to make sure | 995 // Visit a page over https that is a redirect to a page with http (to make sure |
997 // we don't keep the secure state). | 996 // we don't keep the secure state). |
998 // Marked as flaky, see bug 40932. | 997 IN_PROC_BROWSER_TEST_F(SSLUITest, TestRedirectHTTPSToHTTP) { |
999 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestRedirectHTTPSToHTTP) { | |
1000 ASSERT_TRUE(test_server()->Start()); | 998 ASSERT_TRUE(test_server()->Start()); |
1001 ASSERT_TRUE(https_server_.Start()); | 999 ASSERT_TRUE(https_server_.Start()); |
1002 | 1000 |
1003 GURL https_url = https_server_.GetURL("server-redirect?"); | 1001 GURL https_url = https_server_.GetURL("server-redirect?"); |
1004 GURL http_url = test_server()->GetURL("files/ssl/google.html"); | 1002 GURL http_url = test_server()->GetURL("files/ssl/google.html"); |
1005 | 1003 |
1006 ui_test_utils::NavigateToURL(browser(), | 1004 ui_test_utils::NavigateToURL(browser(), |
1007 GURL(https_url.spec() + http_url.spec())); | 1005 GURL(https_url.spec() + http_url.spec())); |
1008 CheckUnauthenticatedState(browser()->GetSelectedWebContents()); | 1006 CheckUnauthenticatedState(browser()->GetSelectedWebContents()); |
1009 } | 1007 } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1120 content::NOTIFICATION_LOAD_STOP, | 1118 content::NOTIFICATION_LOAD_STOP, |
1121 content::Source<NavigationController>(&tab->GetController())); | 1119 content::Source<NavigationController>(&tab->GetController())); |
1122 tab->GetController().GoBack(); | 1120 tab->GetController().GoBack(); |
1123 observer.Wait(); | 1121 observer.Wait(); |
1124 } | 1122 } |
1125 CheckAuthenticatedState(tab, true); | 1123 CheckAuthenticatedState(tab, true); |
1126 } | 1124 } |
1127 | 1125 |
1128 // From a bad HTTPS top frame: | 1126 // From a bad HTTPS top frame: |
1129 // - navigate to an OK HTTPS frame (expected to be still authentication broken). | 1127 // - navigate to an OK HTTPS frame (expected to be still authentication broken). |
1130 // Marked as flaky, see bug 40932. | 1128 IN_PROC_BROWSER_TEST_F(SSLUITest, TestBadFrameNavigation) { |
1131 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestBadFrameNavigation) { | |
1132 ASSERT_TRUE(https_server_.Start()); | 1129 ASSERT_TRUE(https_server_.Start()); |
1133 ASSERT_TRUE(https_server_expired_.Start()); | 1130 ASSERT_TRUE(https_server_expired_.Start()); |
1134 | 1131 |
1135 std::string top_frame_path; | 1132 std::string top_frame_path; |
1136 ASSERT_TRUE(GetTopFramePath(*test_server(), | 1133 ASSERT_TRUE(GetTopFramePath(*test_server(), |
1137 https_server_, | 1134 https_server_, |
1138 https_server_expired_, | 1135 https_server_expired_, |
1139 &top_frame_path)); | 1136 &top_frame_path)); |
1140 | 1137 |
1141 WebContents* tab = browser()->GetSelectedWebContents(); | 1138 WebContents* tab = browser()->GetSelectedWebContents(); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1220 bool is_content_evil = true; | 1217 bool is_content_evil = true; |
1221 std::wstring content_frame_xpath(L"html/frameset/frame[2]"); | 1218 std::wstring content_frame_xpath(L"html/frameset/frame[2]"); |
1222 std::wstring is_evil_js(L"window.domAutomationController.send(" | 1219 std::wstring is_evil_js(L"window.domAutomationController.send(" |
1223 L"document.getElementById('evilDiv') != null);"); | 1220 L"document.getElementById('evilDiv') != null);"); |
1224 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 1221 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
1225 tab->GetRenderViewHost(), content_frame_xpath, is_evil_js, | 1222 tab->GetRenderViewHost(), content_frame_xpath, is_evil_js, |
1226 &is_content_evil)); | 1223 &is_content_evil)); |
1227 EXPECT_FALSE(is_content_evil); | 1224 EXPECT_FALSE(is_content_evil); |
1228 } | 1225 } |
1229 | 1226 |
1230 // Marked as flaky, see bug 40932. | 1227 IN_PROC_BROWSER_TEST_F(SSLUITest, TestUnsafeContentsInWorkerFiltered) { |
1231 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestUnsafeContentsInWorkerFiltered) { | |
1232 ASSERT_TRUE(https_server_.Start()); | 1228 ASSERT_TRUE(https_server_.Start()); |
1233 ASSERT_TRUE(https_server_expired_.Start()); | 1229 ASSERT_TRUE(https_server_expired_.Start()); |
1234 | 1230 |
1235 // This page will spawn a Worker which will try to load content from | 1231 // This page will spawn a Worker which will try to load content from |
1236 // BadCertServer. | 1232 // BadCertServer. |
1237 std::string page_with_unsafe_worker_path; | 1233 std::string page_with_unsafe_worker_path; |
1238 ASSERT_TRUE(GetPageWithUnsafeWorkerPath(https_server_expired_, | 1234 ASSERT_TRUE(GetPageWithUnsafeWorkerPath(https_server_expired_, |
1239 &page_with_unsafe_worker_path)); | 1235 &page_with_unsafe_worker_path)); |
1240 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( | 1236 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( |
1241 page_with_unsafe_worker_path)); | 1237 page_with_unsafe_worker_path)); |
1242 WebContents* tab = browser()->GetSelectedWebContents(); | 1238 WebContents* tab = browser()->GetSelectedWebContents(); |
1243 // Expect Worker not to load insecure content. | 1239 // Expect Worker not to load insecure content. |
1244 CheckWorkerLoadResult(tab, false); | 1240 CheckWorkerLoadResult(tab, false); |
1245 // The bad content is filtered, expect the state to be authenticated. | 1241 // The bad content is filtered, expect the state to be authenticated. |
1246 CheckAuthenticatedState(tab, false); | 1242 CheckAuthenticatedState(tab, false); |
1247 } | 1243 } |
1248 | 1244 |
1249 // Marked as flaky, see bug 40932. | 1245 IN_PROC_BROWSER_TEST_F(SSLUITest, TestUnsafeContentsInWorker) { |
1250 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestUnsafeContentsInWorker) { | |
1251 ASSERT_TRUE(https_server_.Start()); | 1246 ASSERT_TRUE(https_server_.Start()); |
1252 ASSERT_TRUE(https_server_expired_.Start()); | 1247 ASSERT_TRUE(https_server_expired_.Start()); |
1253 | 1248 |
1254 // Navigate to an unsafe site. Proceed with interstitial page to indicate | 1249 // Navigate to an unsafe site. Proceed with interstitial page to indicate |
1255 // the user approves the bad certificate. | 1250 // the user approves the bad certificate. |
1256 ui_test_utils::NavigateToURL(browser(), | 1251 ui_test_utils::NavigateToURL(browser(), |
1257 https_server_expired_.GetURL("files/ssl/blank_page.html")); | 1252 https_server_expired_.GetURL("files/ssl/blank_page.html")); |
1258 WebContents* tab = browser()->GetSelectedWebContents(); | 1253 WebContents* tab = browser()->GetSelectedWebContents(); |
1259 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, | 1254 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
1260 true); // Interstitial showing | 1255 true); // Interstitial showing |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1337 | 1332 |
1338 // Visit a page over https that contains a frame with a redirect. | 1333 // Visit a page over https that contains a frame with a redirect. |
1339 | 1334 |
1340 // XMLHttpRequest insecure content in synchronous mode. | 1335 // XMLHttpRequest insecure content in synchronous mode. |
1341 | 1336 |
1342 // XMLHttpRequest insecure content in asynchronous mode. | 1337 // XMLHttpRequest insecure content in asynchronous mode. |
1343 | 1338 |
1344 // XMLHttpRequest over bad ssl in synchronous mode. | 1339 // XMLHttpRequest over bad ssl in synchronous mode. |
1345 | 1340 |
1346 // XMLHttpRequest over OK ssl in synchronous mode. | 1341 // XMLHttpRequest over OK ssl in synchronous mode. |
OLD | NEW |