| 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..588ea4471a4dd7e6bc6121f281e96487dadc2b4f 100644
|
| --- a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
|
| +++ b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
|
| @@ -275,6 +275,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(); }
|
| @@ -283,6 +286,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_;
|
| }
|
| @@ -410,8 +416,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 +437,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 +466,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,
|
|
|