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

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

Issue 2778853002: Fix flaky DownloadTest.FeedbackServiceKeepDownload (Closed)
Patch Set: address qinmin's comment 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..60ad2acde66980c410077134236434f5fe259d13 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);
@@ -3490,12 +3484,21 @@ 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);
+ std::unique_ptr<DownloadTestObserverNotInProgress> completion_observer(
asanka 2017/03/31 14:37:24 Instead, could you use a DownloadTestObserverTermi
Jialiu Lin 2017/03/31 21:34:33 Done.
Jialiu Lin 2017/03/31 21:34:33 Done.
+ new DownloadTestObserverNotInProgress(
+ DownloadManagerForBrowser(browser()), 1));
+
+ // Make sure download is finished before starting evaluation.
+ if (!completion_observer->IsFinished()) {
+ completion_observer->StartObserving();
+ 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