| 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 "chrome/browser/download/download_browsertest.h" | 5 #include "chrome/browser/download/download_browsertest.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 3419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3430 *(downloads[0]))); | 3430 *(downloads[0]))); |
| 3431 | 3431 |
| 3432 // Begin feedback and check that the file is "stolen". | 3432 // Begin feedback and check that the file is "stolen". |
| 3433 download_protection_service->feedback_service()->BeginFeedbackForDownload( | 3433 download_protection_service->feedback_service()->BeginFeedbackForDownload( |
| 3434 downloads[0], DownloadCommands::DISCARD); | 3434 downloads[0], DownloadCommands::DISCARD); |
| 3435 std::vector<DownloadItem*> updated_downloads; | 3435 std::vector<DownloadItem*> updated_downloads; |
| 3436 GetDownloads(browser(), &updated_downloads); | 3436 GetDownloads(browser(), &updated_downloads); |
| 3437 ASSERT_TRUE(updated_downloads.empty()); | 3437 ASSERT_TRUE(updated_downloads.empty()); |
| 3438 } | 3438 } |
| 3439 | 3439 |
| 3440 IN_PROC_BROWSER_TEST_F(DownloadTest, FeedbackServiceKeepDownload) { | 3440 // Test is flaky Linux. crbug.com/705224 |
| 3441 #if defined(OS_LINUX) |
| 3442 #define MAYBE_FeedbackServiceKeepDownload DISABLED_FeedbackServiceKeepDownload |
| 3443 #else |
| 3444 #define MAYBE_FeedbackServiceKeepDownload FeedbackServiceKeepDownload |
| 3445 #endif |
| 3446 IN_PROC_BROWSER_TEST_F(DownloadTest, MAYBE_FeedbackServiceKeepDownload) { |
| 3441 PrefService* prefs = browser()->profile()->GetPrefs(); | 3447 PrefService* prefs = browser()->profile()->GetPrefs(); |
| 3442 prefs->SetBoolean(prefs::kSafeBrowsingEnabled, true); | 3448 prefs->SetBoolean(prefs::kSafeBrowsingEnabled, true); |
| 3443 safe_browsing::SetExtendedReportingPref(prefs, true); | 3449 safe_browsing::SetExtendedReportingPref(prefs, true); |
| 3444 | 3450 |
| 3445 // Make a dangerous file. | 3451 // Make a dangerous file. |
| 3446 GURL download_url(net::URLRequestMockHTTPJob::GetMockUrl( | 3452 GURL download_url(net::URLRequestMockHTTPJob::GetMockUrl( |
| 3447 "downloads/dangerous/dangerous.swf")); | 3453 "downloads/dangerous/dangerous.swf")); |
| 3448 std::unique_ptr<content::DownloadTestObserverInterrupted> | 3454 std::unique_ptr<content::DownloadTestObserverInterrupted> |
| 3449 interruption_observer(new content::DownloadTestObserverInterrupted( | 3455 interruption_observer(new content::DownloadTestObserverInterrupted( |
| 3450 DownloadManagerForBrowser(browser()), 1, | 3456 DownloadManagerForBrowser(browser()), 1, |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3798 browser(), 1, | 3804 browser(), 1, |
| 3799 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY)); | 3805 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY)); |
| 3800 ui_test_utils::NavigateToURL(browser(), extension_url); | 3806 ui_test_utils::NavigateToURL(browser(), extension_url); |
| 3801 | 3807 |
| 3802 observer->WaitForFinished(); | 3808 observer->WaitForFinished(); |
| 3803 | 3809 |
| 3804 // Download shelf should close. | 3810 // Download shelf should close. |
| 3805 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); | 3811 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); |
| 3806 } | 3812 } |
| 3807 #endif // defined(OS_CHROMEOS) | 3813 #endif // defined(OS_CHROMEOS) |
| OLD | NEW |