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

Side by Side Diff: chrome/browser/download/chrome_download_manager_delegate_unittest.cc

Issue 14593012: BrowserContext should simply own DownloadManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/files/scoped_temp_dir.h" 6 #include "base/files/scoped_temp_dir.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "chrome/browser/download/chrome_download_manager_delegate.h" 10 #include "chrome/browser/download/chrome_download_manager_delegate.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 void OnDownloadTargetDone(DownloadTarget* result, 162 void OnDownloadTargetDone(DownloadTarget* result,
163 const base::FilePath& target_path, 163 const base::FilePath& target_path,
164 DownloadItem::TargetDisposition disposition, 164 DownloadItem::TargetDisposition disposition,
165 content::DownloadDangerType danger_type, 165 content::DownloadDangerType danger_type,
166 const base::FilePath& intermediate_path); 166 const base::FilePath& intermediate_path);
167 167
168 TestingPrefServiceSyncable* pref_service_; 168 TestingPrefServiceSyncable* pref_service_;
169 base::ScopedTempDir test_download_dir_; 169 base::ScopedTempDir test_download_dir_;
170 content::TestBrowserThread ui_thread_; 170 content::TestBrowserThread ui_thread_;
171 content::TestBrowserThread file_thread_; 171 content::TestBrowserThread file_thread_;
172 scoped_refptr<content::MockDownloadManager> download_manager_; 172 scoped_ptr<content::MockDownloadManager> download_manager_;
173 scoped_refptr<TestChromeDownloadManagerDelegate> delegate_; 173 scoped_refptr<TestChromeDownloadManagerDelegate> delegate_;
174 MockWebContentsDelegate web_contents_delegate_; 174 MockWebContentsDelegate web_contents_delegate_;
175 }; 175 };
176 176
177 ChromeDownloadManagerDelegateTest::ChromeDownloadManagerDelegateTest() 177 ChromeDownloadManagerDelegateTest::ChromeDownloadManagerDelegateTest()
178 : ChromeRenderViewHostTestHarness(), 178 : ChromeRenderViewHostTestHarness(),
179 ui_thread_(content::BrowserThread::UI, &message_loop_), 179 ui_thread_(content::BrowserThread::UI, &message_loop_),
180 file_thread_(content::BrowserThread::FILE, &message_loop_), 180 file_thread_(content::BrowserThread::FILE, &message_loop_),
181 download_manager_(new ::testing::NiceMock<content::MockDownloadManager>) { 181 download_manager_(new ::testing::NiceMock<content::MockDownloadManager>) {
182 } 182 }
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 DownloadTarget result; 366 DownloadTarget result;
367 base::FilePath expected_prompt_path(GetPathInDownloadDir("foo.txt")); 367 base::FilePath expected_prompt_path(GetPathInDownloadDir("foo.txt"));
368 EXPECT_CALL(*delegate(), 368 EXPECT_CALL(*delegate(),
369 MockPromptUserForDownloadPath(save_as_download.get(), 369 MockPromptUserForDownloadPath(save_as_download.get(),
370 expected_prompt_path, _)) 370 expected_prompt_path, _))
371 .WillOnce(Return(base::FilePath())); 371 .WillOnce(Return(base::FilePath()));
372 DetermineDownloadTarget(save_as_download.get(), &result); 372 DetermineDownloadTarget(save_as_download.get(), &result);
373 VerifyAndClearExpectations(); 373 VerifyAndClearExpectations();
374 } 374 }
375 } 375 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698