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

Side by Side Diff: content/browser/download/download_manager_impl_unittest.cc

Issue 11147026: Initial refactor to get profiles to propagate storage partition details. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changing bool param to pass by reference. Created 8 years, 2 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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 class MockBrowserContext : public content::BrowserContext { 375 class MockBrowserContext : public content::BrowserContext {
376 public: 376 public:
377 MockBrowserContext() {} 377 MockBrowserContext() {}
378 ~MockBrowserContext() {} 378 ~MockBrowserContext() {}
379 379
380 MOCK_METHOD0(GetPath, FilePath()); 380 MOCK_METHOD0(GetPath, FilePath());
381 MOCK_CONST_METHOD0(IsOffTheRecord, bool()); 381 MOCK_CONST_METHOD0(IsOffTheRecord, bool());
382 MOCK_METHOD0(GetRequestContext, net::URLRequestContextGetter*()); 382 MOCK_METHOD0(GetRequestContext, net::URLRequestContextGetter*());
383 MOCK_METHOD1(GetRequestContextForRenderProcess, 383 MOCK_METHOD1(GetRequestContextForRenderProcess,
384 net::URLRequestContextGetter*(int renderer_child_id)); 384 net::URLRequestContextGetter*(int renderer_child_id));
385 MOCK_METHOD1(GetRequestContextForStoragePartition, 385 MOCK_METHOD2(GetRequestContextForStoragePartition,
386 net::URLRequestContextGetter*(const std::string& id)); 386 net::URLRequestContextGetter*(
387 const FilePath& partition_path, const bool& in_memory));
387 MOCK_METHOD0(GetMediaRequestContext, 388 MOCK_METHOD0(GetMediaRequestContext,
388 net::URLRequestContextGetter*()); 389 net::URLRequestContextGetter*());
389 MOCK_METHOD1(GetMediaRequestContextForRenderProcess, 390 MOCK_METHOD1(GetMediaRequestContextForRenderProcess,
390 net::URLRequestContextGetter*(int renderer_child_id)); 391 net::URLRequestContextGetter*(int renderer_child_id));
391 MOCK_METHOD1(GetMediaRequestContextForStoragePartition, 392 MOCK_METHOD2(GetMediaRequestContextForStoragePartition,
392 net::URLRequestContextGetter*(const std::string& id)); 393 net::URLRequestContextGetter*(
394 const FilePath& partition_path, const bool& in_memory));
393 MOCK_METHOD0(GetResourceContext, content::ResourceContext*()); 395 MOCK_METHOD0(GetResourceContext, content::ResourceContext*());
394 MOCK_METHOD0(GetDownloadManagerDelegate, content::DownloadManagerDelegate*()); 396 MOCK_METHOD0(GetDownloadManagerDelegate, content::DownloadManagerDelegate*());
395 MOCK_METHOD0(GetGeolocationPermissionContext, 397 MOCK_METHOD0(GetGeolocationPermissionContext,
396 content::GeolocationPermissionContext* ()); 398 content::GeolocationPermissionContext* ());
397 MOCK_METHOD0(GetSpeechRecognitionPreferences, 399 MOCK_METHOD0(GetSpeechRecognitionPreferences,
398 content::SpeechRecognitionPreferences* ()); 400 content::SpeechRecognitionPreferences* ());
399 MOCK_METHOD0(GetSpecialStoragePolicy, quota::SpecialStoragePolicy*()); 401 MOCK_METHOD0(GetSpecialStoragePolicy, quota::SpecialStoragePolicy*());
400 }; 402 };
401 403
402 class MockDownloadManagerObserver : public content::DownloadManager::Observer { 404 class MockDownloadManagerObserver : public content::DownloadManager::Observer {
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 EXPECT_CALL(GetMockDownloadManagerDelegate(), 660 EXPECT_CALL(GetMockDownloadManagerDelegate(),
659 UpdateItemInPersistentStore(&item)); 661 UpdateItemInPersistentStore(&item));
660 EXPECT_CALL(item, GetState()) 662 EXPECT_CALL(item, GetState())
661 .WillRepeatedly(Return(DownloadItem::CANCELLED)); 663 .WillRepeatedly(Return(DownloadItem::CANCELLED));
662 EXPECT_CALL(item, GetDbHandle()) 664 EXPECT_CALL(item, GetDbHandle())
663 .WillRepeatedly(Return(db_handle)); 665 .WillRepeatedly(Return(db_handle));
664 666
665 EXPECT_CALL(item, OffThreadCancel()); 667 EXPECT_CALL(item, OffThreadCancel());
666 DownloadStopped(&item); 668 DownloadStopped(&item);
667 } 669 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698