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

Unified Diff: chrome/browser/download/download_browsertest.cc

Issue 2778853002: Fix flaky DownloadTest.FeedbackServiceKeepDownload (Closed)
Patch Set: Use DownloadTestObserverTerminal instead Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_browsertest.cc
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index d5f2deb66f6053911d914c0a59327505824788a1..04ff630eb3d9428135b0a2c7ff7bf014c557d310 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -3437,13 +3437,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, FeedbackServiceDiscardDownload) {
ASSERT_TRUE(updated_downloads.empty());
}
-// Test is flaky Linux. crbug.com/705224
-#if defined(OS_LINUX)
-#define MAYBE_FeedbackServiceKeepDownload DISABLED_FeedbackServiceKeepDownload
-#else
-#define MAYBE_FeedbackServiceKeepDownload FeedbackServiceKeepDownload
-#endif
-IN_PROC_BROWSER_TEST_F(DownloadTest, MAYBE_FeedbackServiceKeepDownload) {
+IN_PROC_BROWSER_TEST_F(DownloadTest, FeedbackServiceKeepDownload) {
PrefService* prefs = browser()->profile()->GetPrefs();
prefs->SetBoolean(prefs::kSafeBrowsingEnabled, true);
safe_browsing::SetExtendedReportingPref(prefs, true);
@@ -3455,6 +3449,10 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, MAYBE_FeedbackServiceKeepDownload) {
interruption_observer(new content::DownloadTestObserverInterrupted(
DownloadManagerForBrowser(browser()), 1,
content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_QUIT));
+ std::unique_ptr<content::DownloadTestObserver> completion_observer(
+ new content::DownloadTestObserverTerminal(
+ DownloadManagerForBrowser(browser()), 1,
+ content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_IGNORE));
ui_test_utils::NavigateToURLWithDisposition(
browser(), GURL(download_url), WindowOpenDisposition::NEW_BACKGROUND_TAB,
ui_test_utils::BROWSER_TEST_NONE);
@@ -3490,12 +3488,13 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, MAYBE_FeedbackServiceKeepDownload) {
// Begin feedback and check that file is still there.
download_protection_service->feedback_service()->BeginFeedbackForDownload(
downloads[0], DownloadCommands::KEEP);
+ completion_observer->WaitForFinished();
std::vector<DownloadItem*> updated_downloads;
GetDownloads(browser(), &updated_downloads);
ASSERT_EQ(std::size_t(1), updated_downloads.size());
ASSERT_FALSE(updated_downloads[0]->IsDangerous());
- ASSERT_TRUE(PathExists(updated_downloads[0]->GetFullPath()));
+ ASSERT_TRUE(PathExists(updated_downloads[0]->GetTargetFilePath()));
updated_downloads[0]->Cancel(true);
}
« 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