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

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

Issue 16295003: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | Annotate | Revision Log
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 SetDefaultDownloadPath(test_download_dir_.path()); 194 SetDefaultDownloadPath(test_download_dir_.path());
195 } 195 }
196 196
197 void ChromeDownloadManagerDelegateTest::TearDown() { 197 void ChromeDownloadManagerDelegateTest::TearDown() {
198 message_loop_.RunUntilIdle(); 198 message_loop_.RunUntilIdle();
199 delegate_->Shutdown(); 199 delegate_->Shutdown();
200 ChromeRenderViewHostTestHarness::TearDown(); 200 ChromeRenderViewHostTestHarness::TearDown();
201 } 201 }
202 202
203 void ChromeDownloadManagerDelegateTest::VerifyAndClearExpectations() { 203 void ChromeDownloadManagerDelegateTest::VerifyAndClearExpectations() {
204 ::testing::Mock::VerifyAndClearExpectations(delegate_); 204 ::testing::Mock::VerifyAndClearExpectations(delegate_.get());
205 } 205 }
206 206
207 content::MockDownloadItem* 207 content::MockDownloadItem*
208 ChromeDownloadManagerDelegateTest::CreateActiveDownloadItem(int32 id) { 208 ChromeDownloadManagerDelegateTest::CreateActiveDownloadItem(int32 id) {
209 content::MockDownloadItem* item = 209 content::MockDownloadItem* item =
210 new ::testing::NiceMock<content::MockDownloadItem>(); 210 new ::testing::NiceMock<content::MockDownloadItem>();
211 ON_CALL(*item, GetBrowserContext()) 211 ON_CALL(*item, GetBrowserContext())
212 .WillByDefault(Return(profile())); 212 .WillByDefault(Return(profile()));
213 ON_CALL(*item, GetDangerType()) 213 ON_CALL(*item, GetDangerType())
214 .WillByDefault(Return(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)); 214 .WillByDefault(Return(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS));
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 DownloadTarget result; 362 DownloadTarget result;
363 base::FilePath expected_prompt_path(GetPathInDownloadDir("foo.txt")); 363 base::FilePath expected_prompt_path(GetPathInDownloadDir("foo.txt"));
364 EXPECT_CALL(*delegate(), 364 EXPECT_CALL(*delegate(),
365 MockPromptUserForDownloadPath(save_as_download.get(), 365 MockPromptUserForDownloadPath(save_as_download.get(),
366 expected_prompt_path, _)) 366 expected_prompt_path, _))
367 .WillOnce(Return(base::FilePath())); 367 .WillOnce(Return(base::FilePath()));
368 DetermineDownloadTarget(save_as_download.get(), &result); 368 DetermineDownloadTarget(save_as_download.get(), &result);
369 VerifyAndClearExpectations(); 369 VerifyAndClearExpectations();
370 } 370 }
371 } 371 }
OLDNEW
« no previous file with comments | « chrome/browser/download/chrome_download_manager_delegate.cc ('k') | chrome/browser/download/download_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698