| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/stringprintf.h" |
| 5 #include "base/time.h" | 6 #include "base/time.h" |
| 6 #include "chrome/app/chrome_dll_resource.h" | 7 #include "chrome/app/chrome_dll_resource.h" |
| 7 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
| 8 #include "chrome/browser/browser_navigator.h" | 9 #include "chrome/browser/browser_navigator.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/profile.h" | 11 #include "chrome/browser/profile.h" |
| 11 #include "chrome/browser/tab_contents/interstitial_page.h" | 12 #include "chrome/browser/tab_contents/interstitial_page.h" |
| 12 #include "chrome/browser/tab_contents/navigation_entry.h" | 13 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 13 #include "chrome/browser/tab_contents/tab_contents.h" | 14 #include "chrome/browser/tab_contents/tab_contents.h" |
| 14 #include "chrome/browser/tabs/tab_strip_model.h" | 15 #include "chrome/browser/tabs/tab_strip_model.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 110 } |
| 110 | 111 |
| 111 void ProceedThroughInterstitial(TabContents* tab) { | 112 void ProceedThroughInterstitial(TabContents* tab) { |
| 112 InterstitialPage* interstitial_page = tab->interstitial_page(); | 113 InterstitialPage* interstitial_page = tab->interstitial_page(); |
| 113 ASSERT_TRUE(interstitial_page); | 114 ASSERT_TRUE(interstitial_page); |
| 114 interstitial_page->Proceed(); | 115 interstitial_page->Proceed(); |
| 115 // Wait for the navigation to be done. | 116 // Wait for the navigation to be done. |
| 116 ui_test_utils::WaitForNavigation(&(tab->controller())); | 117 ui_test_utils::WaitForNavigation(&(tab->controller())); |
| 117 } | 118 } |
| 118 | 119 |
| 120 std::string GetFileWithHostAndPortReplacement( |
| 121 const std::string& original_path, |
| 122 const net::HostPortPair& host_port_pair) const { |
| 123 return StringPrintf("%s?replace_orig=%s&replace_new=%s", |
| 124 original_path.c_str(), |
| 125 kReplaceText_, |
| 126 host_port_pair.ToString().c_str()); |
| 127 } |
| 128 |
| 119 net::TestServer https_server_; | 129 net::TestServer https_server_; |
| 120 net::TestServer https_server_expired_; | 130 net::TestServer https_server_expired_; |
| 121 net::TestServer https_server_mismatched_; | 131 net::TestServer https_server_mismatched_; |
| 122 | 132 |
| 123 private: | 133 private: |
| 124 DISALLOW_COPY_AND_ASSIGN(SSLUITest); | 134 DISALLOW_COPY_AND_ASSIGN(SSLUITest); |
| 135 |
| 136 static const char* const kReplaceText_; |
| 125 }; | 137 }; |
| 126 | 138 |
| 139 // static |
| 140 const char* const SSLUITest::kReplaceText_ = "REPLACE_WITH_HOST_AND_PORT"; |
| 141 |
| 127 // Visits a regular page over http. | 142 // Visits a regular page over http. |
| 128 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTP) { | 143 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTP) { |
| 129 ASSERT_TRUE(test_server()->Start()); | 144 ASSERT_TRUE(test_server()->Start()); |
| 130 | 145 |
| 131 ui_test_utils::NavigateToURL(browser(), | 146 ui_test_utils::NavigateToURL(browser(), |
| 132 test_server()->GetURL("files/ssl/google.html")); | 147 test_server()->GetURL("files/ssl/google.html")); |
| 133 | 148 |
| 134 CheckUnauthenticatedState(browser()->GetSelectedTabContents()); | 149 CheckUnauthenticatedState(browser()->GetSelectedTabContents()); |
| 135 } | 150 } |
| 136 | 151 |
| 137 // Visits a page over http which includes broken https resources (status should | 152 // Visits a page over http which includes broken https resources (status should |
| 138 // be OK). | 153 // be OK). |
| 139 // TODO(jcampan): test that bad HTTPS content is blocked (otherwise we'll give | 154 // TODO(jcampan): test that bad HTTPS content is blocked (otherwise we'll give |
| 140 // the secure cookies away!). | 155 // the secure cookies away!). |
| 141 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPWithBrokenHTTPSResource) { | 156 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPWithBrokenHTTPSResource) { |
| 142 ASSERT_TRUE(test_server()->Start()); | 157 ASSERT_TRUE(test_server()->Start()); |
| 143 ASSERT_TRUE(https_server_expired_.Start()); | 158 ASSERT_TRUE(https_server_expired_.Start()); |
| 144 | 159 |
| 145 ui_test_utils::NavigateToURL(browser(), | 160 std::string replacement_path = GetFileWithHostAndPortReplacement( |
| 146 test_server()->GetURL("files/ssl/page_with_unsafe_contents.html")); | 161 "files/ssl/page_with_unsafe_contents.html", |
| 162 https_server_expired_.host_port_pair()); |
| 163 |
| 164 ui_test_utils::NavigateToURL( |
| 165 browser(), test_server()->GetURL(replacement_path)); |
| 147 | 166 |
| 148 CheckUnauthenticatedState(browser()->GetSelectedTabContents()); | 167 CheckUnauthenticatedState(browser()->GetSelectedTabContents()); |
| 149 } | 168 } |
| 150 | 169 |
| 151 // Visits a page over OK https: | 170 // Visits a page over OK https: |
| 152 IN_PROC_BROWSER_TEST_F(SSLUITest, TestOKHTTPS) { | 171 IN_PROC_BROWSER_TEST_F(SSLUITest, TestOKHTTPS) { |
| 153 ASSERT_TRUE(https_server_.Start()); | 172 ASSERT_TRUE(https_server_.Start()); |
| 154 | 173 |
| 155 ui_test_utils::NavigateToURL(browser(), | 174 ui_test_utils::NavigateToURL(browser(), |
| 156 https_server_.GetURL("files/ssl/google.html")); | 175 https_server_.GetURL("files/ssl/google.html")); |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 375 |
| 357 // | 376 // |
| 358 // Insecure content | 377 // Insecure content |
| 359 // | 378 // |
| 360 | 379 |
| 361 // Visits a page that displays insecure content. | 380 // Visits a page that displays insecure content. |
| 362 IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysInsecureContent) { | 381 IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysInsecureContent) { |
| 363 ASSERT_TRUE(test_server()->Start()); | 382 ASSERT_TRUE(test_server()->Start()); |
| 364 ASSERT_TRUE(https_server_.Start()); | 383 ASSERT_TRUE(https_server_.Start()); |
| 365 | 384 |
| 385 std::string replacement_path = GetFileWithHostAndPortReplacement( |
| 386 "files/ssl/page_displays_insecure_content.html", |
| 387 test_server()->host_port_pair()); |
| 388 |
| 366 // Load a page that displays insecure content. | 389 // Load a page that displays insecure content. |
| 367 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( | 390 ui_test_utils::NavigateToURL(browser(), |
| 368 "files/ssl/page_displays_insecure_content.html")); | 391 https_server_.GetURL(replacement_path)); |
| 369 | 392 |
| 370 CheckAuthenticatedState(browser()->GetSelectedTabContents(), true); | 393 CheckAuthenticatedState(browser()->GetSelectedTabContents(), true); |
| 371 } | 394 } |
| 372 | 395 |
| 373 // Visits a page that runs insecure content and tries to suppress the insecure | 396 // Visits a page that runs insecure content and tries to suppress the insecure |
| 374 // content warnings by randomizing location.hash. | 397 // content warnings by randomizing location.hash. |
| 375 // Based on http://crbug.com/8706 | 398 // Based on http://crbug.com/8706 |
| 376 // Fails to terminate on all platforms. See bug http://crbug.com/58230 | 399 // Fails to terminate on all platforms. See bug http://crbug.com/58230 |
| 377 IN_PROC_BROWSER_TEST_F(SSLUITest, | 400 IN_PROC_BROWSER_TEST_F(SSLUITest, |
| 378 DISABLED_TestRunsInsecuredContentRandomizeHash) { | 401 DISABLED_TestRunsInsecuredContentRandomizeHash) { |
| 379 ASSERT_TRUE(test_server()->Start()); | 402 ASSERT_TRUE(test_server()->Start()); |
| 380 ASSERT_TRUE(https_server_.Start()); | 403 ASSERT_TRUE(https_server_.Start()); |
| 381 | 404 |
| 382 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( | 405 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( |
| 383 "files/ssl/page_runs_insecure_content.html")); | 406 "files/ssl/page_runs_insecure_content.html")); |
| 384 | 407 |
| 385 CheckAuthenticationBrokenState(browser()->GetSelectedTabContents(), 0, true, | 408 CheckAuthenticationBrokenState(browser()->GetSelectedTabContents(), 0, true, |
| 386 false); | 409 false); |
| 387 } | 410 } |
| 388 | 411 |
| 389 // Visits a page with unsafe content and make sure that: | 412 // Visits a page with unsafe content and make sure that: |
| 390 // - frames content is replaced with warning | 413 // - frames content is replaced with warning |
| 391 // - images and scripts are filtered out entirely | 414 // - images and scripts are filtered out entirely |
| 392 // Marked as flaky, see bug 40932. | 415 // Marked as flaky, see bug 40932. |
| 393 IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestUnsafeContents) { | 416 IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestUnsafeContents) { |
| 394 ASSERT_TRUE(https_server_.Start()); | 417 ASSERT_TRUE(https_server_.Start()); |
| 395 ASSERT_TRUE(https_server_expired_.Start()); | 418 ASSERT_TRUE(https_server_expired_.Start()); |
| 396 | 419 |
| 397 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( | 420 std::string replacement_path = GetFileWithHostAndPortReplacement( |
| 398 "files/ssl/page_with_unsafe_contents.html")); | 421 "files/ssl/page_with_unsafe_contents.html", |
| 422 https_server_expired_.host_port_pair()); |
| 423 ui_test_utils::NavigateToURL(browser(), |
| 424 https_server_.GetURL(replacement_path)); |
| 399 | 425 |
| 400 TabContents* tab = browser()->GetSelectedTabContents(); | 426 TabContents* tab = browser()->GetSelectedTabContents(); |
| 401 // When the bad content is filtered, the state is expected to be | 427 // When the bad content is filtered, the state is expected to be |
| 402 // authenticated. | 428 // authenticated. |
| 403 CheckAuthenticatedState(tab, false); | 429 CheckAuthenticatedState(tab, false); |
| 404 | 430 |
| 405 // Because of cross-frame scripting restrictions, we cannot access the iframe | 431 // Because of cross-frame scripting restrictions, we cannot access the iframe |
| 406 // content. So to know if the frame was loaded, we just check if a popup was | 432 // content. So to know if the frame was loaded, we just check if a popup was |
| 407 // opened (the iframe content opens one). | 433 // opened (the iframe content opens one). |
| 408 // Note: because of bug 1115868, no constrained window is opened right now. | 434 // Note: because of bug 1115868, no constrained window is opened right now. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 424 L"window.domAutomationController.send(IsFooSet());", &js_result)); | 450 L"window.domAutomationController.send(IsFooSet());", &js_result)); |
| 425 EXPECT_FALSE(js_result); | 451 EXPECT_FALSE(js_result); |
| 426 } | 452 } |
| 427 | 453 |
| 428 // Visits a page with insecure content loaded by JS (after the initial page | 454 // Visits a page with insecure content loaded by JS (after the initial page |
| 429 // load). | 455 // load). |
| 430 IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysInsecureContentLoadedFromJS) { | 456 IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysInsecureContentLoadedFromJS) { |
| 431 ASSERT_TRUE(test_server()->Start()); | 457 ASSERT_TRUE(test_server()->Start()); |
| 432 ASSERT_TRUE(https_server_.Start()); | 458 ASSERT_TRUE(https_server_.Start()); |
| 433 | 459 |
| 460 std::string replacement_path = GetFileWithHostAndPortReplacement( |
| 461 "files/ssl/page_with_dynamic_insecure_content.html", |
| 462 test_server()->host_port_pair()); |
| 434 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( | 463 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( |
| 435 "files/ssl/page_with_dynamic_insecure_content.html")); | 464 replacement_path)); |
| 436 | 465 |
| 437 TabContents* tab = browser()->GetSelectedTabContents(); | 466 TabContents* tab = browser()->GetSelectedTabContents(); |
| 438 CheckAuthenticatedState(tab, false); | 467 CheckAuthenticatedState(tab, false); |
| 439 | 468 |
| 440 // Load the insecure image. | 469 // Load the insecure image. |
| 441 bool js_result = false; | 470 bool js_result = false; |
| 442 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 471 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 443 tab->render_view_host(), std::wstring(), L"loadBadImage();", &js_result)); | 472 tab->render_view_host(), std::wstring(), L"loadBadImage();", &js_result)); |
| 444 EXPECT_TRUE(js_result); | 473 EXPECT_TRUE(js_result); |
| 445 | 474 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 456 | 485 |
| 457 ui_test_utils::NavigateToURL(browser(), | 486 ui_test_utils::NavigateToURL(browser(), |
| 458 https_server_.GetURL("files/ssl/blank_page.html")); | 487 https_server_.GetURL("files/ssl/blank_page.html")); |
| 459 | 488 |
| 460 TabContents* tab1 = browser()->GetSelectedTabContents(); | 489 TabContents* tab1 = browser()->GetSelectedTabContents(); |
| 461 | 490 |
| 462 // This tab should be fine. | 491 // This tab should be fine. |
| 463 CheckAuthenticatedState(tab1, false); | 492 CheckAuthenticatedState(tab1, false); |
| 464 | 493 |
| 465 // Create a new tab. | 494 // Create a new tab. |
| 466 GURL url = https_server_.GetURL( | 495 std::string replacement_path = GetFileWithHostAndPortReplacement( |
| 467 "files/ssl/page_displays_insecure_content.html"); | 496 "files/ssl/page_displays_insecure_content.html", |
| 497 test_server()->host_port_pair()); |
| 498 |
| 499 GURL url = https_server_.GetURL(replacement_path); |
| 468 browser::NavigateParams params(browser(), url, PageTransition::TYPED); | 500 browser::NavigateParams params(browser(), url, PageTransition::TYPED); |
| 469 params.disposition = NEW_FOREGROUND_TAB; | 501 params.disposition = NEW_FOREGROUND_TAB; |
| 470 params.tabstrip_index = 0; | 502 params.tabstrip_index = 0; |
| 471 params.source_contents = tab1; | 503 params.source_contents = tab1; |
| 472 browser::Navigate(¶ms); | 504 browser::Navigate(¶ms); |
| 473 TabContents* tab2 = params.target_contents; | 505 TabContents* tab2 = params.target_contents; |
| 474 ui_test_utils::WaitForNavigation(&(tab2->controller())); | 506 ui_test_utils::WaitForNavigation(&(tab2->controller())); |
| 475 | 507 |
| 476 // The new tab has insecure content. | 508 // The new tab has insecure content. |
| 477 CheckAuthenticatedState(tab2, true); | 509 CheckAuthenticatedState(tab2, true); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 488 ASSERT_TRUE(https_server_.Start()); | 520 ASSERT_TRUE(https_server_.Start()); |
| 489 | 521 |
| 490 ui_test_utils::NavigateToURL(browser(), | 522 ui_test_utils::NavigateToURL(browser(), |
| 491 https_server_.GetURL("files/ssl/blank_page.html")); | 523 https_server_.GetURL("files/ssl/blank_page.html")); |
| 492 | 524 |
| 493 TabContents* tab1 = browser()->GetSelectedTabContents(); | 525 TabContents* tab1 = browser()->GetSelectedTabContents(); |
| 494 | 526 |
| 495 // This tab should be fine. | 527 // This tab should be fine. |
| 496 CheckAuthenticatedState(tab1, false); | 528 CheckAuthenticatedState(tab1, false); |
| 497 | 529 |
| 530 std::string replacement_path = GetFileWithHostAndPortReplacement( |
| 531 "files/ssl/page_runs_insecure_content.html", |
| 532 test_server()->host_port_pair()); |
| 533 |
| 498 // Create a new tab. | 534 // Create a new tab. |
| 499 GURL url = | 535 GURL url = https_server_.GetURL(replacement_path); |
| 500 https_server_.GetURL("files/ssl/page_runs_insecure_content.html"); | |
| 501 browser::NavigateParams params(browser(), url, PageTransition::TYPED); | 536 browser::NavigateParams params(browser(), url, PageTransition::TYPED); |
| 502 params.disposition = NEW_FOREGROUND_TAB; | 537 params.disposition = NEW_FOREGROUND_TAB; |
| 503 params.source_contents = tab1; | 538 params.source_contents = tab1; |
| 504 browser::Navigate(¶ms); | 539 browser::Navigate(¶ms); |
| 505 TabContents* tab2 = params.target_contents; | 540 TabContents* tab2 = params.target_contents; |
| 506 ui_test_utils::WaitForNavigation(&(tab2->controller())); | 541 ui_test_utils::WaitForNavigation(&(tab2->controller())); |
| 507 | 542 |
| 508 // The new tab has insecure content. | 543 // The new tab has insecure content. |
| 509 CheckAuthenticationBrokenState(tab2, 0, true, false); | 544 CheckAuthenticationBrokenState(tab2, 0, true, false); |
| 510 | 545 |
| 511 // Which means the origin for the first tab has also been contaminated with | 546 // Which means the origin for the first tab has also been contaminated with |
| 512 // insecure content. | 547 // insecure content. |
| 513 CheckAuthenticationBrokenState(tab1, 0, true, false); | 548 CheckAuthenticationBrokenState(tab1, 0, true, false); |
| 514 } | 549 } |
| 515 | 550 |
| 516 // Visits a page with an image over http. Visits another page over https | 551 // Visits a page with an image over http. Visits another page over https |
| 517 // referencing that same image over http (hoping it is coming from the webcore | 552 // referencing that same image over http (hoping it is coming from the webcore |
| 518 // memory cache). | 553 // memory cache). |
| 519 IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysCachedInsecureContent) { | 554 IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysCachedInsecureContent) { |
| 520 ASSERT_TRUE(test_server()->Start()); | 555 ASSERT_TRUE(test_server()->Start()); |
| 521 ASSERT_TRUE(https_server_.Start()); | 556 ASSERT_TRUE(https_server_.Start()); |
| 522 | 557 |
| 523 ui_test_utils::NavigateToURL(browser(), test_server()->GetURL( | 558 std::string replacement_path = GetFileWithHostAndPortReplacement( |
| 524 "files/ssl/page_displays_insecure_content.html")); | 559 "files/ssl/page_displays_insecure_content.html", |
| 560 test_server()->host_port_pair()); |
| 561 |
| 562 // Load original page over HTTP. |
| 563 const GURL url_http = test_server()->GetURL(replacement_path); |
| 564 ui_test_utils::NavigateToURL(browser(), url_http); |
| 525 TabContents* tab = browser()->GetSelectedTabContents(); | 565 TabContents* tab = browser()->GetSelectedTabContents(); |
| 526 CheckUnauthenticatedState(tab); | 566 CheckUnauthenticatedState(tab); |
| 527 | 567 |
| 528 // Load again but over SSL. It should be marked as displaying insecure | 568 // Load again but over SSL. It should be marked as displaying insecure |
| 529 // content (even though the image comes from the WebCore memory cache). | 569 // content (even though the image comes from the WebCore memory cache). |
| 530 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( | 570 const GURL url_https = https_server_.GetURL(replacement_path); |
| 531 "files/ssl/page_displays_insecure_content.html")); | 571 ui_test_utils::NavigateToURL(browser(), url_https); |
| 532 CheckAuthenticatedState(tab, true); | 572 CheckAuthenticatedState(tab, true); |
| 533 } | 573 } |
| 534 | 574 |
| 535 // Visits a page with script over http. Visits another page over https | 575 // Visits a page with script over http. Visits another page over https |
| 536 // referencing that same script over http (hoping it is coming from the webcore | 576 // referencing that same script over http (hoping it is coming from the webcore |
| 537 // memory cache). | 577 // memory cache). |
| 538 IN_PROC_BROWSER_TEST_F(SSLUITest, TestRunsCachedInsecureContent) { | 578 IN_PROC_BROWSER_TEST_F(SSLUITest, TestRunsCachedInsecureContent) { |
| 539 ASSERT_TRUE(test_server()->Start()); | 579 ASSERT_TRUE(test_server()->Start()); |
| 540 ASSERT_TRUE(https_server_.Start()); | 580 ASSERT_TRUE(https_server_.Start()); |
| 541 | 581 |
| 542 ui_test_utils::NavigateToURL(browser(), | 582 std::string replacement_path = GetFileWithHostAndPortReplacement( |
| 543 test_server()->GetURL("files/ssl/page_runs_insecure_content.html")); | 583 "files/ssl/page_runs_insecure_content.html", |
| 584 test_server()->host_port_pair()); |
| 585 |
| 586 // Load original page over HTTP. |
| 587 const GURL url_http = test_server()->GetURL(replacement_path); |
| 588 ui_test_utils::NavigateToURL(browser(), url_http); |
| 544 TabContents* tab = browser()->GetSelectedTabContents(); | 589 TabContents* tab = browser()->GetSelectedTabContents(); |
| 545 CheckUnauthenticatedState(tab); | 590 CheckUnauthenticatedState(tab); |
| 546 | 591 |
| 547 // Load again but over SSL. It should be marked as displaying insecure | 592 // Load again but over SSL. It should be marked as displaying insecure |
| 548 // content (even though the image comes from the WebCore memory cache). | 593 // content (even though the image comes from the WebCore memory cache). |
| 549 ui_test_utils::NavigateToURL(browser(), https_server_.GetURL( | 594 const GURL url_https = https_server_.GetURL(replacement_path); |
| 550 "files/ssl/page_runs_insecure_content.html")); | 595 ui_test_utils::NavigateToURL(browser(), url_https); |
| 551 CheckAuthenticationBrokenState(tab, 0, true, false); | 596 CheckAuthenticationBrokenState(tab, 0, true, false); |
| 552 } | 597 } |
| 553 | 598 |
| 554 #if defined(OS_WIN) | 599 #if defined(OS_WIN) |
| 555 // See http://crbug.com/47170 | 600 // See http://crbug.com/47170 |
| 556 #define MAYBE_TestCNInvalidStickiness FLAKY_TestCNInvalidStickiness | 601 #define MAYBE_TestCNInvalidStickiness FLAKY_TestCNInvalidStickiness |
| 557 #else | 602 #else |
| 558 #define MAYBE_TestCNInvalidStickiness TestCNInvalidStickiness | 603 #define MAYBE_TestCNInvalidStickiness TestCNInvalidStickiness |
| 559 #endif | 604 #endif |
| 560 | 605 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 } | 664 } |
| 620 | 665 |
| 621 // Tests that closing a page that has a unsafe pop-up does not crash the | 666 // Tests that closing a page that has a unsafe pop-up does not crash the |
| 622 // browser (bug #1966). | 667 // browser (bug #1966). |
| 623 // TODO(jcampan): http://crbug.com/2136 disabled because the popup is not | 668 // TODO(jcampan): http://crbug.com/2136 disabled because the popup is not |
| 624 // opened as it is not initiated by a user gesture. | 669 // opened as it is not initiated by a user gesture. |
| 625 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestCloseTabWithUnsafePopup) { | 670 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestCloseTabWithUnsafePopup) { |
| 626 ASSERT_TRUE(test_server()->Start()); | 671 ASSERT_TRUE(test_server()->Start()); |
| 627 ASSERT_TRUE(https_server_expired_.Start()); | 672 ASSERT_TRUE(https_server_expired_.Start()); |
| 628 | 673 |
| 674 std::string replacement_path = GetFileWithHostAndPortReplacement( |
| 675 "files/ssl/page_with_unsafe_popup.html", |
| 676 https_server_expired_.host_port_pair()); |
| 677 |
| 629 ui_test_utils::NavigateToURL(browser(), | 678 ui_test_utils::NavigateToURL(browser(), |
| 630 test_server()->GetURL("files/ssl/page_with_unsafe_popup.html")); | 679 test_server()->GetURL(replacement_path)); |
| 631 | 680 |
| 632 TabContents* tab1 = browser()->GetSelectedTabContents(); | 681 TabContents* tab1 = browser()->GetSelectedTabContents(); |
| 633 // It is probably overkill to add a notification for a popup-opening, let's | 682 // It is probably overkill to add a notification for a popup-opening, let's |
| 634 // just poll. | 683 // just poll. |
| 635 for (int i = 0; i < 10; i++) { | 684 for (int i = 0; i < 10; i++) { |
| 636 if (static_cast<int>(tab1->constrained_window_count()) > 0) | 685 if (static_cast<int>(tab1->constrained_window_count()) > 0) |
| 637 break; | 686 break; |
| 638 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 687 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 639 new MessageLoop::QuitTask(), 1000); | 688 new MessageLoop::QuitTask(), 1000); |
| 640 ui_test_utils::RunMessageLoop(); | 689 ui_test_utils::RunMessageLoop(); |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 | 1012 |
| 964 // Visit a page over https that contains a frame with a redirect. | 1013 // Visit a page over https that contains a frame with a redirect. |
| 965 | 1014 |
| 966 // XMLHttpRequest insecure content in synchronous mode. | 1015 // XMLHttpRequest insecure content in synchronous mode. |
| 967 | 1016 |
| 968 // XMLHttpRequest insecure content in asynchronous mode. | 1017 // XMLHttpRequest insecure content in asynchronous mode. |
| 969 | 1018 |
| 970 // XMLHttpRequest over bad ssl in synchronous mode. | 1019 // XMLHttpRequest over bad ssl in synchronous mode. |
| 971 | 1020 |
| 972 // XMLHttpRequest over OK ssl in synchronous mode. | 1021 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |