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

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

Issue 1408393004: Fixing flakiness of SaveDownloadableIFrame test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing... Created 5 years, 2 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/save_page_browsertest.cc
diff --git a/chrome/browser/download/save_page_browsertest.cc b/chrome/browser/download/save_page_browsertest.cc
index 3f0749594d0e6497a9ee1dccdc03146fda96f44f..42f1a69cfa8a01ad40f8b93b01ccccfadefb4a8b 100644
--- a/chrome/browser/download/save_page_browsertest.cc
+++ b/chrome/browser/download/save_page_browsertest.cc
@@ -156,7 +156,7 @@ bool DownloadStoredProperly(
// This function may be called multiple times for a given test. Returning
// false doesn't necessarily mean that the test has failed or will fail, it
// might just mean that the test hasn't passed yet.
- if (info.target_path != expected_path) {
+ if (!expected_path.empty() && info.target_path != expected_path) {
DVLOG(20) << __FUNCTION__ << " " << info.target_path.value()
<< " != " << expected_path.value();
return false;
@@ -773,16 +773,25 @@ IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, SavePageBrowserTest_NonMHTML) {
// Test that we don't crash when the page contains an iframe that
// was handled as a download (http://crbug.com/42212).
-// Flaky: https://crbug.com/537530.
-IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, DISABLED_SaveDownloadableIFrame) {
+IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, SaveDownloadableIFrame) {
GURL url = URLRequestMockHTTPJob::GetMockUrl(
"downloads/iframe-src-is-a-download.htm");
- ui_test_utils::NavigateToURL(browser(), url);
// Wait for and then dismiss the non-save-page-as-related download item
// (the one associated with downloading of "thisdayinhistory.xls" file).
- VerifySavePackageExpectations(browser(), url);
- GetDownloadManager()->RemoveAllDownloads();
+ {
+ GURL download_url("http://mock.http/downloads/thisdayinhistory.xls");
+ DownloadPersistedObserver persisted(
+ browser()->profile(),
+ base::Bind(&DownloadStoredProperly, download_url, base::FilePath(), -1,
+ history::DownloadState::COMPLETE));
+
+ ui_test_utils::NavigateToURL(browser(), url);
+
+ ASSERT_TRUE(VerifySavePackageExpectations(browser(), download_url));
+ persisted.WaitForPersisted();
+ GetDownloadManager()->RemoveAllDownloads();
+ }
base::FilePath full_file_name, dir;
SaveCurrentTab(url, content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML,
« 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