Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(810)

Side by Side Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 10837262: Re-enable SSLUITest.TestBadHTTPSDownload and get test exiting cleanly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/path_service.h" 6 #include "base/path_service.h"
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "chrome/app/chrome_command_ids.h" 11 #include "chrome/app/chrome_command_ids.h"
12 #include "chrome/browser/download/download_test_observer.h"
13 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/ui/browser.h" 14 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/browser_commands.h" 15 #include "chrome/browser/ui/browser_commands.h"
14 #include "chrome/browser/ui/browser_navigator.h" 16 #include "chrome/browser/ui/browser_navigator.h"
15 #include "chrome/browser/ui/browser_tabstrip.h" 17 #include "chrome/browser/ui/browser_tabstrip.h"
16 #include "chrome/browser/ui/constrained_window_tab_helper.h" 18 #include "chrome/browser/ui/constrained_window_tab_helper.h"
17 #include "chrome/browser/ui/tab_contents/tab_contents.h" 19 #include "chrome/browser/ui/tab_contents/tab_contents.h"
18 #include "chrome/browser/ui/tabs/tab_strip_model.h" 20 #include "chrome/browser/ui/tabs/tab_strip_model.h"
19 #include "chrome/common/chrome_notification_types.h" 21 #include "chrome/common/chrome_notification_types.h"
20 #include "chrome/common/chrome_paths.h" 22 #include "chrome/common/chrome_paths.h"
21 #include "chrome/common/chrome_switches.h" 23 #include "chrome/common/chrome_switches.h"
22 #include "chrome/test/base/in_process_browser_test.h" 24 #include "chrome/test/base/in_process_browser_test.h"
23 #include "chrome/test/base/ui_test_utils.h" 25 #include "chrome/test/base/ui_test_utils.h"
26 #include "content/public/browser/browser_context.h"
24 #include "content/public/browser/interstitial_page.h" 27 #include "content/public/browser/interstitial_page.h"
25 #include "content/public/browser/navigation_controller.h" 28 #include "content/public/browser/navigation_controller.h"
26 #include "content/public/browser/navigation_entry.h" 29 #include "content/public/browser/navigation_entry.h"
27 #include "content/public/browser/notification_service.h" 30 #include "content/public/browser/notification_service.h"
28 #include "content/public/browser/render_view_host.h" 31 #include "content/public/browser/render_view_host.h"
29 #include "content/public/browser/web_contents.h" 32 #include "content/public/browser/web_contents.h"
30 #include "content/public/browser/web_contents_observer.h" 33 #include "content/public/browser/web_contents_observer.h"
31 #include "content/public/common/security_style.h" 34 #include "content/public/common/security_style.h"
32 #include "content/public/common/ssl_status.h" 35 #include "content/public/common/ssl_status.h"
33 #include "content/public/test/browser_test_utils.h" 36 #include "content/public/test/browser_test_utils.h"
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 browser(), url, content::PAGE_TRANSITION_TYPED); 631 browser(), url, content::PAGE_TRANSITION_TYPED);
629 content::WaitForLoadStop(tab2->web_contents()); 632 content::WaitForLoadStop(tab2->web_contents());
630 633
631 // Verify our assumption that there was no prior navigation. 634 // Verify our assumption that there was no prior navigation.
632 EXPECT_FALSE(chrome::CanGoBack(browser())); 635 EXPECT_FALSE(chrome::CanGoBack(browser()));
633 636
634 // We should have an interstitial page showing. 637 // We should have an interstitial page showing.
635 ASSERT_TRUE(tab2->web_contents()->GetInterstitialPage()); 638 ASSERT_TRUE(tab2->web_contents()->GetInterstitialPage());
636 } 639 }
637 640
638 // Disabled due to crash in downloads code that this triggers. 641 IN_PROC_BROWSER_TEST_F(SSLUITest, TestBadHTTPSDownload) {
639 // http://crbug.com/95331
640 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestBadHTTPSDownload) {
641 ASSERT_TRUE(test_server()->Start()); 642 ASSERT_TRUE(test_server()->Start());
642 ASSERT_TRUE(https_server_expired_.Start()); 643 ASSERT_TRUE(https_server_expired_.Start());
643 GURL url_non_dangerous = test_server()->GetURL(""); 644 GURL url_non_dangerous = test_server()->GetURL("");
644 GURL url_dangerous = https_server_expired_.GetURL( 645 GURL url_dangerous = https_server_expired_.GetURL(
645 "files/downloads/dangerous/dangerous.exe"); 646 "files/downloads/dangerous/dangerous.exe");
646 647
647 // Visit a non-dangerous page. 648 // Visit a non-dangerous page.
648 ui_test_utils::NavigateToURL(browser(), url_non_dangerous); 649 ui_test_utils::NavigateToURL(browser(), url_non_dangerous);
649 650
650 // Now, start a transition to dangerous download. 651 // Now, start a transition to dangerous download.
(...skipping 20 matching lines...) Expand all
671 observer.Wait(); 672 observer.Wait();
672 } 673 }
673 674
674 // There should still be an interstitial at this point. Press the 675 // There should still be an interstitial at this point. Press the
675 // back button on the browser. Note that this doesn't wait for a 676 // back button on the browser. Note that this doesn't wait for a
676 // NAV_ENTRY_COMMITTED notification because going back with an 677 // NAV_ENTRY_COMMITTED notification because going back with an
677 // active interstitial simply hides the interstitial. 678 // active interstitial simply hides the interstitial.
678 ASSERT_TRUE(tab->GetInterstitialPage() != NULL); 679 ASSERT_TRUE(tab->GetInterstitialPage() != NULL);
679 EXPECT_TRUE(chrome::CanGoBack(browser())); 680 EXPECT_TRUE(chrome::CanGoBack(browser()));
680 chrome::GoBack(browser(), CURRENT_TAB); 681 chrome::GoBack(browser(), CURRENT_TAB);
682
683 // To exit the browser cleanly we need to complete the download.
684 {
685 DownloadTestObserverTerminal observer(
686 content::BrowserContext::GetDownloadManager(browser()->profile()),
687 1,
688 DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_ACCEPT);
Randy Smith (Not in Mondays) 2012/08/15 18:27:06 You want to split these two lines apart, and make
689 observer.WaitForFinished();
690 }
681 } 691 }
682 692
683 // 693 //
684 // Insecure content 694 // Insecure content
685 // 695 //
686 696
687 // Visits a page that displays insecure content. 697 // Visits a page that displays insecure content.
688 IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysInsecureContent) { 698 IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysInsecureContent) {
689 ASSERT_TRUE(test_server()->Start()); 699 ASSERT_TRUE(test_server()->Start());
690 ASSERT_TRUE(https_server_.Start()); 700 ASSERT_TRUE(https_server_.Start());
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 1506
1497 // Visit a page over https that contains a frame with a redirect. 1507 // Visit a page over https that contains a frame with a redirect.
1498 1508
1499 // XMLHttpRequest insecure content in synchronous mode. 1509 // XMLHttpRequest insecure content in synchronous mode.
1500 1510
1501 // XMLHttpRequest insecure content in asynchronous mode. 1511 // XMLHttpRequest insecure content in asynchronous mode.
1502 1512
1503 // XMLHttpRequest over bad ssl in synchronous mode. 1513 // XMLHttpRequest over bad ssl in synchronous mode.
1504 1514
1505 // XMLHttpRequest over OK ssl in synchronous mode. 1515 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698