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/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/prefs/pref_service.h" |
12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
14 #include "chrome/browser/ui/browser_commands.h" | 15 #include "chrome/browser/ui/browser_commands.h" |
15 #include "chrome/browser/ui/browser_navigator.h" | 16 #include "chrome/browser/ui/browser_navigator.h" |
16 #include "chrome/browser/ui/browser_tabstrip.h" | 17 #include "chrome/browser/ui/browser_tabstrip.h" |
17 #include "chrome/browser/ui/constrained_window_tab_helper.h" | 18 #include "chrome/browser/ui/constrained_window_tab_helper.h" |
18 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 19 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
19 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 20 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
20 #include "chrome/common/chrome_notification_types.h" | 21 #include "chrome/common/chrome_notification_types.h" |
21 #include "chrome/common/chrome_paths.h" | 22 #include "chrome/common/chrome_paths.h" |
22 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
| 24 #include "chrome/common/pref_names.h" |
23 #include "chrome/test/base/in_process_browser_test.h" | 25 #include "chrome/test/base/in_process_browser_test.h" |
24 #include "chrome/test/base/ui_test_utils.h" | 26 #include "chrome/test/base/ui_test_utils.h" |
25 #include "content/public/browser/browser_context.h" | 27 #include "content/public/browser/browser_context.h" |
26 #include "content/public/browser/interstitial_page.h" | 28 #include "content/public/browser/interstitial_page.h" |
27 #include "content/public/browser/navigation_controller.h" | 29 #include "content/public/browser/navigation_controller.h" |
28 #include "content/public/browser/navigation_entry.h" | 30 #include "content/public/browser/navigation_entry.h" |
29 #include "content/public/browser/notification_service.h" | 31 #include "content/public/browser/notification_service.h" |
30 #include "content/public/browser/render_view_host.h" | 32 #include "content/public/browser/render_view_host.h" |
31 #include "content/public/browser/web_contents.h" | 33 #include "content/public/browser/web_contents.h" |
32 #include "content/public/browser/web_contents_observer.h" | 34 #include "content/public/browser/web_contents_observer.h" |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 browser(), url, content::PAGE_TRANSITION_TYPED); | 635 browser(), url, content::PAGE_TRANSITION_TYPED); |
634 content::WaitForLoadStop(tab2->web_contents()); | 636 content::WaitForLoadStop(tab2->web_contents()); |
635 | 637 |
636 // Verify our assumption that there was no prior navigation. | 638 // Verify our assumption that there was no prior navigation. |
637 EXPECT_FALSE(chrome::CanGoBack(browser())); | 639 EXPECT_FALSE(chrome::CanGoBack(browser())); |
638 | 640 |
639 // We should have an interstitial page showing. | 641 // We should have an interstitial page showing. |
640 ASSERT_TRUE(tab2->web_contents()->GetInterstitialPage()); | 642 ASSERT_TRUE(tab2->web_contents()->GetInterstitialPage()); |
641 } | 643 } |
642 | 644 |
643 // The test crashes on Mac and Linux, cause is unclear. | 645 IN_PROC_BROWSER_TEST_F(SSLUITest, TestBadHTTPSDownload) { |
644 // http://crbug.com/144624 | |
645 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestBadHTTPSDownload) { | |
646 ASSERT_TRUE(test_server()->Start()); | 646 ASSERT_TRUE(test_server()->Start()); |
647 ASSERT_TRUE(https_server_expired_.Start()); | 647 ASSERT_TRUE(https_server_expired_.Start()); |
648 GURL url_non_dangerous = test_server()->GetURL(""); | 648 GURL url_non_dangerous = test_server()->GetURL(""); |
649 GURL url_dangerous = https_server_expired_.GetURL( | 649 GURL url_dangerous = https_server_expired_.GetURL( |
650 "files/downloads/dangerous/dangerous.exe"); | 650 "files/downloads/dangerous/dangerous.exe"); |
| 651 ScopedTempDir downloads_directory_; |
| 652 |
| 653 // Need empty temp dir to avoid having Chrome ask us for a new filename |
| 654 // when we've downloaded dangerous.exe one hundred times. |
| 655 ASSERT_TRUE(downloads_directory_.CreateUniqueTempDir()); |
| 656 |
| 657 browser()->profile()->GetPrefs()->SetFilePath( |
| 658 prefs::kDownloadDefaultDirectory, |
| 659 downloads_directory_.path()); |
651 | 660 |
652 // Visit a non-dangerous page. | 661 // Visit a non-dangerous page. |
653 ui_test_utils::NavigateToURL(browser(), url_non_dangerous); | 662 ui_test_utils::NavigateToURL(browser(), url_non_dangerous); |
654 | 663 |
655 // Now, start a transition to dangerous download. | 664 // Now, start a transition to dangerous download. |
656 { | 665 { |
657 content::WindowedNotificationObserver observer( | 666 content::WindowedNotificationObserver observer( |
658 content::NOTIFICATION_LOAD_STOP, | 667 content::NOTIFICATION_LOAD_STOP, |
659 content::NotificationService::AllSources()); | 668 content::NotificationService::AllSources()); |
660 chrome::NavigateParams navigate_params(browser(), url_dangerous, | 669 chrome::NavigateParams navigate_params(browser(), url_dangerous, |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 | 1519 |
1511 // Visit a page over https that contains a frame with a redirect. | 1520 // Visit a page over https that contains a frame with a redirect. |
1512 | 1521 |
1513 // XMLHttpRequest insecure content in synchronous mode. | 1522 // XMLHttpRequest insecure content in synchronous mode. |
1514 | 1523 |
1515 // XMLHttpRequest insecure content in asynchronous mode. | 1524 // XMLHttpRequest insecure content in asynchronous mode. |
1516 | 1525 |
1517 // XMLHttpRequest over bad ssl in synchronous mode. | 1526 // XMLHttpRequest over bad ssl in synchronous mode. |
1518 | 1527 |
1519 // XMLHttpRequest over OK ssl in synchronous mode. | 1528 // XMLHttpRequest over OK ssl in synchronous mode. |
OLD | NEW |