Chromium Code Reviews| 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. | 401 // See bug 114185. |
|
wtc
2012/02/17 19:43:03
This line should also be removed.
tpayne
2012/02/17 19:47:38
Done.
| |
| 403 // Marked as flaky, see bug 40932. | |
| 404 IN_PROC_BROWSER_TEST_F(SSLUITest, | 402 IN_PROC_BROWSER_TEST_F(SSLUITest, |
| 405 DISABLED_TestHTTPSExpiredCertAndGoBackViaMenu) { | 403 TestHTTPSExpiredCertAndGoBackViaMenu) { |
| 406 ASSERT_TRUE(test_server()->Start()); | 404 ASSERT_TRUE(test_server()->Start()); |
| 407 ASSERT_TRUE(https_server_expired_.Start()); | 405 ASSERT_TRUE(https_server_expired_.Start()); |
| 408 | 406 |
| 409 // First navigate to an HTTP page. | 407 // First navigate to an HTTP page. |
| 410 ui_test_utils::NavigateToURL(browser(), | 408 ui_test_utils::NavigateToURL(browser(), |
| 411 test_server()->GetURL("files/ssl/google.html")); | 409 test_server()->GetURL("files/ssl/google.html")); |
| 412 WebContents* tab = browser()->GetSelectedWebContents(); | 410 WebContents* tab = browser()->GetSelectedWebContents(); |
| 413 NavigationEntry* entry = tab->GetController().GetActiveEntry(); | 411 NavigationEntry* entry = tab->GetController().GetActiveEntry(); |
| 414 ASSERT_TRUE(entry); | 412 ASSERT_TRUE(entry); |
| 415 | 413 |
| 416 // Now go to a bad HTTPS page that shows an interstitial. | 414 // Now go to a bad HTTPS page that shows an interstitial. |
| 417 ui_test_utils::NavigateToURL(browser(), | 415 ui_test_utils::NavigateToURL(browser(), |
| 418 https_server_expired_.GetURL("files/ssl/google.html")); | 416 https_server_expired_.GetURL("files/ssl/google.html")); |
| 419 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, | 417 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
| 420 true); // Interstitial showing | 418 true); // Interstitial showing |
| 421 | 419 |
| 422 // Simulate user clicking and holding on back button (crbug.com/37215). | 420 // Simulate user clicking and holding on back button (crbug.com/37215). |
| 423 tab->GetController().GoToOffset(-1); | 421 tab->GetController().GoToOffset(-1); |
| 424 | 422 |
| 425 // We should be back at the original good page. | 423 // We should be back at the original good page. |
| 426 EXPECT_FALSE(browser()->GetSelectedWebContents()->GetInterstitialPage()); | 424 EXPECT_FALSE(browser()->GetSelectedWebContents()->GetInterstitialPage()); |
| 427 CheckUnauthenticatedState(tab); | 425 CheckUnauthenticatedState(tab); |
| 428 } | 426 } |
| 429 | 427 |
| 430 // Visits a page with https error and then goes forward using GoToOffset. | 428 // Visits a page with https error and then goes forward using GoToOffset. |
| 431 // Marked as flaky, see bug 40932. | 429 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSExpiredCertAndGoForward) { |
| 432 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestHTTPSExpiredCertAndGoForward) { | |
| 433 ASSERT_TRUE(test_server()->Start()); | 430 ASSERT_TRUE(test_server()->Start()); |
| 434 ASSERT_TRUE(https_server_expired_.Start()); | 431 ASSERT_TRUE(https_server_expired_.Start()); |
| 435 | 432 |
| 436 // First navigate to two HTTP pages. | 433 // First navigate to two HTTP pages. |
| 437 ui_test_utils::NavigateToURL(browser(), | 434 ui_test_utils::NavigateToURL(browser(), |
| 438 test_server()->GetURL("files/ssl/google.html")); | 435 test_server()->GetURL("files/ssl/google.html")); |
| 439 WebContents* tab = browser()->GetSelectedWebContents(); | 436 WebContents* tab = browser()->GetSelectedWebContents(); |
| 440 NavigationEntry* entry1 = tab->GetController().GetActiveEntry(); | 437 NavigationEntry* entry1 = tab->GetController().GetActiveEntry(); |
| 441 ASSERT_TRUE(entry1); | 438 ASSERT_TRUE(entry1); |
| 442 ui_test_utils::NavigateToURL(browser(), | 439 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( | 581 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( |
| 585 "files/ssl/page_runs_insecure_content.html")); | 582 "files/ssl/page_runs_insecure_content.html")); |
| 586 | 583 |
| 587 CheckAuthenticationBrokenState(browser()->GetSelectedWebContents(), 0, true, | 584 CheckAuthenticationBrokenState(browser()->GetSelectedWebContents(), 0, true, |
| 588 false); | 585 false); |
| 589 } | 586 } |
| 590 | 587 |
| 591 // Visits a page with unsafe content and make sure that: | 588 // Visits a page with unsafe content and make sure that: |
| 592 // - frames content is replaced with warning | 589 // - frames content is replaced with warning |
| 593 // - images and scripts are filtered out entirely | 590 // - images and scripts are filtered out entirely |
| 594 // Marked as flaky, see bug 40932. | 591 IN_PROC_BROWSER_TEST_F(SSLUITest, TestUnsafeContents) { |
| 595 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestUnsafeContents) { | |
| 596 ASSERT_TRUE(https_server_.Start()); | 592 ASSERT_TRUE(https_server_.Start()); |
| 597 ASSERT_TRUE(https_server_expired_.Start()); | 593 ASSERT_TRUE(https_server_expired_.Start()); |
| 598 | 594 |
| 599 std::string replacement_path; | 595 std::string replacement_path; |
| 600 ASSERT_TRUE(GetFilePathWithHostAndPortReplacement( | 596 ASSERT_TRUE(GetFilePathWithHostAndPortReplacement( |
| 601 "files/ssl/page_with_unsafe_contents.html", | 597 "files/ssl/page_with_unsafe_contents.html", |
| 602 https_server_expired_.host_port_pair(), | 598 https_server_expired_.host_port_pair(), |
| 603 &replacement_path)); | 599 &replacement_path)); |
| 604 ui_test_utils::NavigateToURL(browser(), | 600 ui_test_utils::NavigateToURL(browser(), |
| 605 https_server_.GetURL(replacement_path)); | 601 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, | 925 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
| 930 true); // Interstitial showing. | 926 true); // Interstitial showing. |
| 931 | 927 |
| 932 ProceedThroughInterstitial(tab); | 928 ProceedThroughInterstitial(tab); |
| 933 | 929 |
| 934 // We have been redirected to the good page. | 930 // We have been redirected to the good page. |
| 935 CheckAuthenticatedState(tab, false); | 931 CheckAuthenticatedState(tab, false); |
| 936 } | 932 } |
| 937 | 933 |
| 938 // Visit a page over good https that is a redirect to a page with bad https. | 934 // Visit a page over good https that is a redirect to a page with bad https. |
| 939 // Marked as flaky, see bug 40932. | 935 IN_PROC_BROWSER_TEST_F(SSLUITest, TestRedirectGoodToBadHTTPS) { |
| 940 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestRedirectGoodToBadHTTPS) { | |
| 941 ASSERT_TRUE(https_server_.Start()); | 936 ASSERT_TRUE(https_server_.Start()); |
| 942 ASSERT_TRUE(https_server_expired_.Start()); | 937 ASSERT_TRUE(https_server_expired_.Start()); |
| 943 | 938 |
| 944 GURL url1 = https_server_.GetURL("server-redirect?"); | 939 GURL url1 = https_server_.GetURL("server-redirect?"); |
| 945 GURL url2 = https_server_expired_.GetURL("files/ssl/google.html"); | 940 GURL url2 = https_server_expired_.GetURL("files/ssl/google.html"); |
| 946 ui_test_utils::NavigateToURL(browser(), GURL(url1.spec() + url2.spec())); | 941 ui_test_utils::NavigateToURL(browser(), GURL(url1.spec() + url2.spec())); |
| 947 | 942 |
| 948 WebContents* tab = browser()->GetSelectedWebContents(); | 943 WebContents* tab = browser()->GetSelectedWebContents(); |
| 949 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, | 944 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
| 950 true); // Interstitial showing. | 945 true); // Interstitial showing. |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 966 GURL http_url = test_server()->GetURL("server-redirect?"); | 961 GURL http_url = test_server()->GetURL("server-redirect?"); |
| 967 GURL good_https_url = | 962 GURL good_https_url = |
| 968 https_server_.GetURL("files/ssl/google.html"); | 963 https_server_.GetURL("files/ssl/google.html"); |
| 969 | 964 |
| 970 ui_test_utils::NavigateToURL(browser(), | 965 ui_test_utils::NavigateToURL(browser(), |
| 971 GURL(http_url.spec() + good_https_url.spec())); | 966 GURL(http_url.spec() + good_https_url.spec())); |
| 972 CheckAuthenticatedState(tab, false); | 967 CheckAuthenticatedState(tab, false); |
| 973 } | 968 } |
| 974 | 969 |
| 975 // Visit a page over http that is a redirect to a page with bad HTTPS. | 970 // Visit a page over http that is a redirect to a page with bad HTTPS. |
| 976 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestRedirectHTTPToBadHTTPS) { | 971 IN_PROC_BROWSER_TEST_F(SSLUITest, TestRedirectHTTPToBadHTTPS) { |
| 977 ASSERT_TRUE(test_server()->Start()); | 972 ASSERT_TRUE(test_server()->Start()); |
| 978 ASSERT_TRUE(https_server_expired_.Start()); | 973 ASSERT_TRUE(https_server_expired_.Start()); |
| 979 | 974 |
| 980 WebContents* tab = browser()->GetSelectedWebContents(); | 975 WebContents* tab = browser()->GetSelectedWebContents(); |
| 981 | 976 |
| 982 GURL http_url = test_server()->GetURL("server-redirect?"); | 977 GURL http_url = test_server()->GetURL("server-redirect?"); |
| 983 GURL bad_https_url = | 978 GURL bad_https_url = |
| 984 https_server_expired_.GetURL("files/ssl/google.html"); | 979 https_server_expired_.GetURL("files/ssl/google.html"); |
| 985 ui_test_utils::NavigateToURL(browser(), | 980 ui_test_utils::NavigateToURL(browser(), |
| 986 GURL(http_url.spec() + bad_https_url.spec())); | 981 GURL(http_url.spec() + bad_https_url.spec())); |
| 987 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, | 982 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
| 988 true); // Interstitial showing. | 983 true); // Interstitial showing. |
| 989 | 984 |
| 990 ProceedThroughInterstitial(tab); | 985 ProceedThroughInterstitial(tab); |
| 991 | 986 |
| 992 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, | 987 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
| 993 false); // No interstitial showing. | 988 false); // No interstitial showing. |
| 994 } | 989 } |
| 995 | 990 |
| 996 // Visit a page over https that is a redirect to a page with http (to make sure | 991 // 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). | 992 // we don't keep the secure state). |
| 998 // Marked as flaky, see bug 40932. | 993 IN_PROC_BROWSER_TEST_F(SSLUITest, TestRedirectHTTPSToHTTP) { |
| 999 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestRedirectHTTPSToHTTP) { | |
| 1000 ASSERT_TRUE(test_server()->Start()); | 994 ASSERT_TRUE(test_server()->Start()); |
| 1001 ASSERT_TRUE(https_server_.Start()); | 995 ASSERT_TRUE(https_server_.Start()); |
| 1002 | 996 |
| 1003 GURL https_url = https_server_.GetURL("server-redirect?"); | 997 GURL https_url = https_server_.GetURL("server-redirect?"); |
| 1004 GURL http_url = test_server()->GetURL("files/ssl/google.html"); | 998 GURL http_url = test_server()->GetURL("files/ssl/google.html"); |
| 1005 | 999 |
| 1006 ui_test_utils::NavigateToURL(browser(), | 1000 ui_test_utils::NavigateToURL(browser(), |
| 1007 GURL(https_url.spec() + http_url.spec())); | 1001 GURL(https_url.spec() + http_url.spec())); |
| 1008 CheckUnauthenticatedState(browser()->GetSelectedWebContents()); | 1002 CheckUnauthenticatedState(browser()->GetSelectedWebContents()); |
| 1009 } | 1003 } |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1120 content::NOTIFICATION_LOAD_STOP, | 1114 content::NOTIFICATION_LOAD_STOP, |
| 1121 content::Source<NavigationController>(&tab->GetController())); | 1115 content::Source<NavigationController>(&tab->GetController())); |
| 1122 tab->GetController().GoBack(); | 1116 tab->GetController().GoBack(); |
| 1123 observer.Wait(); | 1117 observer.Wait(); |
| 1124 } | 1118 } |
| 1125 CheckAuthenticatedState(tab, true); | 1119 CheckAuthenticatedState(tab, true); |
| 1126 } | 1120 } |
| 1127 | 1121 |
| 1128 // From a bad HTTPS top frame: | 1122 // From a bad HTTPS top frame: |
| 1129 // - navigate to an OK HTTPS frame (expected to be still authentication broken). | 1123 // - navigate to an OK HTTPS frame (expected to be still authentication broken). |
| 1130 // Marked as flaky, see bug 40932. | 1124 IN_PROC_BROWSER_TEST_F(SSLUITest, TestBadFrameNavigation) { |
| 1131 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestBadFrameNavigation) { | |
| 1132 ASSERT_TRUE(https_server_.Start()); | 1125 ASSERT_TRUE(https_server_.Start()); |
| 1133 ASSERT_TRUE(https_server_expired_.Start()); | 1126 ASSERT_TRUE(https_server_expired_.Start()); |
| 1134 | 1127 |
| 1135 std::string top_frame_path; | 1128 std::string top_frame_path; |
| 1136 ASSERT_TRUE(GetTopFramePath(*test_server(), | 1129 ASSERT_TRUE(GetTopFramePath(*test_server(), |
| 1137 https_server_, | 1130 https_server_, |
| 1138 https_server_expired_, | 1131 https_server_expired_, |
| 1139 &top_frame_path)); | 1132 &top_frame_path)); |
| 1140 | 1133 |
| 1141 WebContents* tab = browser()->GetSelectedWebContents(); | 1134 WebContents* tab = browser()->GetSelectedWebContents(); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1220 bool is_content_evil = true; | 1213 bool is_content_evil = true; |
| 1221 std::wstring content_frame_xpath(L"html/frameset/frame[2]"); | 1214 std::wstring content_frame_xpath(L"html/frameset/frame[2]"); |
| 1222 std::wstring is_evil_js(L"window.domAutomationController.send(" | 1215 std::wstring is_evil_js(L"window.domAutomationController.send(" |
| 1223 L"document.getElementById('evilDiv') != null);"); | 1216 L"document.getElementById('evilDiv') != null);"); |
| 1224 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 1217 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 1225 tab->GetRenderViewHost(), content_frame_xpath, is_evil_js, | 1218 tab->GetRenderViewHost(), content_frame_xpath, is_evil_js, |
| 1226 &is_content_evil)); | 1219 &is_content_evil)); |
| 1227 EXPECT_FALSE(is_content_evil); | 1220 EXPECT_FALSE(is_content_evil); |
| 1228 } | 1221 } |
| 1229 | 1222 |
| 1230 // Marked as flaky, see bug 40932. | 1223 IN_PROC_BROWSER_TEST_F(SSLUITest, TestUnsafeContentsInWorkerFiltered) { |
| 1231 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestUnsafeContentsInWorkerFiltered) { | |
| 1232 ASSERT_TRUE(https_server_.Start()); | 1224 ASSERT_TRUE(https_server_.Start()); |
| 1233 ASSERT_TRUE(https_server_expired_.Start()); | 1225 ASSERT_TRUE(https_server_expired_.Start()); |
| 1234 | 1226 |
| 1235 // This page will spawn a Worker which will try to load content from | 1227 // This page will spawn a Worker which will try to load content from |
| 1236 // BadCertServer. | 1228 // BadCertServer. |
| 1237 std::string page_with_unsafe_worker_path; | 1229 std::string page_with_unsafe_worker_path; |
| 1238 ASSERT_TRUE(GetPageWithUnsafeWorkerPath(https_server_expired_, | 1230 ASSERT_TRUE(GetPageWithUnsafeWorkerPath(https_server_expired_, |
| 1239 &page_with_unsafe_worker_path)); | 1231 &page_with_unsafe_worker_path)); |
| 1240 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( | 1232 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( |
| 1241 page_with_unsafe_worker_path)); | 1233 page_with_unsafe_worker_path)); |
| 1242 WebContents* tab = browser()->GetSelectedWebContents(); | 1234 WebContents* tab = browser()->GetSelectedWebContents(); |
| 1243 // Expect Worker not to load insecure content. | 1235 // Expect Worker not to load insecure content. |
| 1244 CheckWorkerLoadResult(tab, false); | 1236 CheckWorkerLoadResult(tab, false); |
| 1245 // The bad content is filtered, expect the state to be authenticated. | 1237 // The bad content is filtered, expect the state to be authenticated. |
| 1246 CheckAuthenticatedState(tab, false); | 1238 CheckAuthenticatedState(tab, false); |
| 1247 } | 1239 } |
| 1248 | 1240 |
| 1249 // Marked as flaky, see bug 40932. | 1241 IN_PROC_BROWSER_TEST_F(SSLUITest, TestUnsafeContentsInWorker) { |
| 1250 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestUnsafeContentsInWorker) { | |
| 1251 ASSERT_TRUE(https_server_.Start()); | 1242 ASSERT_TRUE(https_server_.Start()); |
| 1252 ASSERT_TRUE(https_server_expired_.Start()); | 1243 ASSERT_TRUE(https_server_expired_.Start()); |
| 1253 | 1244 |
| 1254 // Navigate to an unsafe site. Proceed with interstitial page to indicate | 1245 // Navigate to an unsafe site. Proceed with interstitial page to indicate |
| 1255 // the user approves the bad certificate. | 1246 // the user approves the bad certificate. |
| 1256 ui_test_utils::NavigateToURL(browser(), | 1247 ui_test_utils::NavigateToURL(browser(), |
| 1257 https_server_expired_.GetURL("files/ssl/blank_page.html")); | 1248 https_server_expired_.GetURL("files/ssl/blank_page.html")); |
| 1258 WebContents* tab = browser()->GetSelectedWebContents(); | 1249 WebContents* tab = browser()->GetSelectedWebContents(); |
| 1259 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, | 1250 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, false, |
| 1260 true); // Interstitial showing | 1251 true); // Interstitial showing |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1337 | 1328 |
| 1338 // Visit a page over https that contains a frame with a redirect. | 1329 // Visit a page over https that contains a frame with a redirect. |
| 1339 | 1330 |
| 1340 // XMLHttpRequest insecure content in synchronous mode. | 1331 // XMLHttpRequest insecure content in synchronous mode. |
| 1341 | 1332 |
| 1342 // XMLHttpRequest insecure content in asynchronous mode. | 1333 // XMLHttpRequest insecure content in asynchronous mode. |
| 1343 | 1334 |
| 1344 // XMLHttpRequest over bad ssl in synchronous mode. | 1335 // XMLHttpRequest over bad ssl in synchronous mode. |
| 1345 | 1336 |
| 1346 // XMLHttpRequest over OK ssl in synchronous mode. | 1337 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |