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

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 r148594 to and resolve conflicts with r148576 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 b0e5373f0badec2d1889483e4404e2fb293d2455..fca8ecdd5d73752c5ea82dcf213020e43cb79639 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
@@ -277,6 +277,9 @@ class DownloadExtensionTest : public ExtensionApiTest {
prefs::kPromptForDownload, false);
GetOnRecordManager()->RemoveAllDownloads();
events_listener_.reset(new DownloadsEventsListener());
+ // Disable file chooser for current profile.
+ DownloadTestFileChooserObserver observer(current_browser()->profile());
+ observer.EnableFileChooser(false);
}
void GoOnTheRecord() { current_browser_ = browser(); }
@@ -285,6 +288,9 @@ class DownloadExtensionTest : public ExtensionApiTest {
if (!incognito_browser_) {
incognito_browser_ = CreateIncognitoBrowser();
GetOffRecordManager()->RemoveAllDownloads();
+ // Disable file chooser for incognito profile.
+ DownloadTestFileChooserObserver observer(incognito_browser_->profile());
+ observer.EnableFileChooser(false);
}
current_browser_ = incognito_browser_;
}
@@ -393,8 +399,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());
@@ -416,9 +420,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);
@@ -448,14 +449,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,
« no previous file with comments | « chrome/browser/download/download_test_observer.cc ('k') | chrome/browser/extensions/crx_installer_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698