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