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

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: Removed macro and InMemory. 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 class MockBrowserContext : public content::BrowserContext { 374 class MockBrowserContext : public content::BrowserContext {
375 public: 375 public:
376 MockBrowserContext() {} 376 MockBrowserContext() {}
377 ~MockBrowserContext() {} 377 ~MockBrowserContext() {}
378 378
379 MOCK_METHOD0(GetPath, FilePath()); 379 MOCK_METHOD0(GetPath, FilePath());
380 MOCK_CONST_METHOD0(IsOffTheRecord, bool()); 380 MOCK_CONST_METHOD0(IsOffTheRecord, bool());
381 MOCK_METHOD0(GetRequestContext, net::URLRequestContextGetter*()); 381 MOCK_METHOD0(GetRequestContext, net::URLRequestContextGetter*());
382 MOCK_METHOD1(GetRequestContextForRenderProcess, 382 MOCK_METHOD1(GetRequestContextForRenderProcess,
383 net::URLRequestContextGetter*(int renderer_child_id)); 383 net::URLRequestContextGetter*(int renderer_child_id));
384 MOCK_METHOD1(GetRequestContextForStoragePartition, 384 MOCK_METHOD2(GetRequestContextForStoragePartition,
385 net::URLRequestContextGetter*(const std::string& id)); 385 net::URLRequestContextGetter*(
386 const FilePath& partition_path, bool in_memory));
386 MOCK_METHOD0(GetMediaRequestContext, 387 MOCK_METHOD0(GetMediaRequestContext,
387 net::URLRequestContextGetter*()); 388 net::URLRequestContextGetter*());
388 MOCK_METHOD1(GetMediaRequestContextForRenderProcess, 389 MOCK_METHOD1(GetMediaRequestContextForRenderProcess,
389 net::URLRequestContextGetter*(int renderer_child_id)); 390 net::URLRequestContextGetter*(int renderer_child_id));
390 MOCK_METHOD1(GetMediaRequestContextForStoragePartition, 391 MOCK_METHOD2(GetMediaRequestContextForStoragePartition,
391 net::URLRequestContextGetter*(const std::string& id)); 392 net::URLRequestContextGetter*(
393 const FilePath& partition_path, bool in_memory));
392 MOCK_METHOD0(GetResourceContext, content::ResourceContext*()); 394 MOCK_METHOD0(GetResourceContext, content::ResourceContext*());
393 MOCK_METHOD0(GetDownloadManagerDelegate, content::DownloadManagerDelegate*()); 395 MOCK_METHOD0(GetDownloadManagerDelegate, content::DownloadManagerDelegate*());
394 MOCK_METHOD0(GetGeolocationPermissionContext, 396 MOCK_METHOD0(GetGeolocationPermissionContext,
395 content::GeolocationPermissionContext* ()); 397 content::GeolocationPermissionContext* ());
396 MOCK_METHOD0(GetSpeechRecognitionPreferences, 398 MOCK_METHOD0(GetSpeechRecognitionPreferences,
397 content::SpeechRecognitionPreferences* ()); 399 content::SpeechRecognitionPreferences* ());
398 MOCK_METHOD0(GetSpecialStoragePolicy, quota::SpecialStoragePolicy*()); 400 MOCK_METHOD0(GetSpecialStoragePolicy, quota::SpecialStoragePolicy*());
399 }; 401 };
400 402
401 class MockDownloadManagerObserver : public content::DownloadManager::Observer { 403 class MockDownloadManagerObserver : public content::DownloadManager::Observer {
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 .WillRepeatedly(Return(true)); 694 .WillRepeatedly(Return(true));
693 EXPECT_CALL(GetMockDownloadManagerDelegate(), 695 EXPECT_CALL(GetMockDownloadManagerDelegate(),
694 UpdateItemInPersistentStore(&item)); 696 UpdateItemInPersistentStore(&item));
695 EXPECT_CALL(item, GetState()) 697 EXPECT_CALL(item, GetState())
696 .WillRepeatedly(Return(DownloadItem::CANCELLED)); 698 .WillRepeatedly(Return(DownloadItem::CANCELLED));
697 EXPECT_CALL(item, GetDbHandle()) 699 EXPECT_CALL(item, GetDbHandle())
698 .WillRepeatedly(Return(db_handle)); 700 .WillRepeatedly(Return(db_handle));
699 701
700 DownloadStopped(&item); 702 DownloadStopped(&item);
701 } 703 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698