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

Unified Diff: chrome/browser/extensions/api/downloads/downloads_api_unittest.cc

Issue 10704052: Download filename determination refactor (3/3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with r147256 Created 8 years, 5 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
Index: chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
diff --git a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
index bba9b21695994887a0ed7caed9314baa259b00b7..faa8dfd0aa521b96099cf0873a3039a2b38a6568 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
@@ -275,6 +275,8 @@ class DownloadExtensionTest : public ExtensionApiTest {
prefs::kPromptForDownload, false);
GetOnRecordManager()->RemoveAllDownloads();
events_listener_.reset(new DownloadsEventsListener());
+ file_chooser_observer_.reset(new DownloadTestFileChooserObserver(
+ current_browser()->profile()));
}
void GoOnTheRecord() { current_browser_ = browser(); }
@@ -410,8 +412,6 @@ class DownloadExtensionTest : public ExtensionApiTest {
observer->WaitForFinished();
EXPECT_EQ(
1u, observer->NumDownloadsSeenInState(DownloadItem::IN_PROGRESS));
- // We don't expect a select file dialog.
- ASSERT_FALSE(observer->select_file_dialog_seen());
}
GetCurrentManager()->GetAllDownloads(FilePath(), items);
ASSERT_EQ(count, items->size());
@@ -433,9 +433,6 @@ class DownloadExtensionTest : public ExtensionApiTest {
observer->WaitForFinished();
EXPECT_EQ(1u, observer->NumDownloadsSeenInState(DownloadItem::IN_PROGRESS));
- // We don't expect a select file dialog.
- if (observer->select_file_dialog_seen())
- return NULL;
DownloadManager::DownloadVector items;
manager->GetAllDownloads(FilePath(), &items);
@@ -465,14 +462,14 @@ class DownloadExtensionTest : public ExtensionApiTest {
DownloadTestObserver* CreateDownloadObserver(size_t download_count) {
return new DownloadTestObserverTerminal(
- GetCurrentManager(), download_count, true,
+ GetCurrentManager(), download_count,
DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_FAIL);
}
DownloadTestObserver* CreateInProgressDownloadObserver(
size_t download_count) {
return new DownloadTestObserverInProgress(
- GetCurrentManager(), download_count, true);
+ GetCurrentManager(), download_count);
}
bool RunFunction(UIThreadExtensionFunction* function,
@@ -574,6 +571,7 @@ class DownloadExtensionTest : public ExtensionApiTest {
Browser* incognito_browser_;
Browser* current_browser_;
scoped_ptr<DownloadsEventsListener> events_listener_;
+ scoped_ptr<DownloadTestFileChooserObserver> file_chooser_observer_;
DISALLOW_COPY_AND_ASSIGN(DownloadExtensionTest);
};

Powered by Google App Engine
This is Rietveld 408576698