| OLD | NEW | 
|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/test/testing_profile.h" | 5 #include "chrome/test/testing_profile.h" | 
| 6 | 6 | 
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" | 
| 8 | 8 | 
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" | 
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" | 
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 51 #include "content/browser/geolocation/geolocation_permission_context.h" | 51 #include "content/browser/geolocation/geolocation_permission_context.h" | 
| 52 #include "content/browser/in_process_webkit/webkit_context.h" | 52 #include "content/browser/in_process_webkit/webkit_context.h" | 
| 53 #include "content/browser/mock_resource_context.h" | 53 #include "content/browser/mock_resource_context.h" | 
| 54 #include "content/common/notification_service.h" | 54 #include "content/common/notification_service.h" | 
| 55 #include "net/base/cookie_monster.h" | 55 #include "net/base/cookie_monster.h" | 
| 56 #include "net/url_request/url_request_context.h" | 56 #include "net/url_request/url_request_context.h" | 
| 57 #include "net/url_request/url_request_context_getter.h" | 57 #include "net/url_request/url_request_context_getter.h" | 
| 58 #include "net/url_request/url_request_test_util.h" | 58 #include "net/url_request/url_request_test_util.h" | 
| 59 #include "testing/gmock/include/gmock/gmock.h" | 59 #include "testing/gmock/include/gmock/gmock.h" | 
| 60 #include "webkit/database/database_tracker.h" | 60 #include "webkit/database/database_tracker.h" | 
|  | 61 #include "webkit/fileapi/file_system_context.h" | 
|  | 62 #include "webkit/quota/quota_manager.h" | 
| 61 | 63 | 
| 62 using base::Time; | 64 using base::Time; | 
| 63 using testing::NiceMock; | 65 using testing::NiceMock; | 
| 64 using testing::Return; | 66 using testing::Return; | 
| 65 | 67 | 
| 66 namespace { | 68 namespace { | 
| 67 | 69 | 
| 68 // Task used to make sure history has finished processing a request. Intended | 70 // Task used to make sure history has finished processing a request. Intended | 
| 69 // for use with BlockUntilHistoryProcessesPendingRequests. | 71 // for use with BlockUntilHistoryProcessesPendingRequests. | 
| 70 | 72 | 
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 506 | 508 | 
| 507 DownloadManager* TestingProfile::GetDownloadManager() { | 509 DownloadManager* TestingProfile::GetDownloadManager() { | 
| 508   return NULL; | 510   return NULL; | 
| 509 } | 511 } | 
| 510 | 512 | 
| 511 PersonalDataManager* TestingProfile::GetPersonalDataManager() { | 513 PersonalDataManager* TestingProfile::GetPersonalDataManager() { | 
| 512   return NULL; | 514   return NULL; | 
| 513 } | 515 } | 
| 514 | 516 | 
| 515 fileapi::FileSystemContext* TestingProfile::GetFileSystemContext() { | 517 fileapi::FileSystemContext* TestingProfile::GetFileSystemContext() { | 
| 516   return NULL; | 518   if (!file_system_context_) { | 
|  | 519     file_system_context_ = new fileapi::FileSystemContext( | 
|  | 520       BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 
|  | 521       BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 
|  | 522       GetExtensionSpecialStoragePolicy(), | 
|  | 523       GetQuotaManager()->proxy(), | 
|  | 524       GetPath(), | 
|  | 525       IsOffTheRecord(), | 
|  | 526       true,  // Allow file access from files. | 
|  | 527       true,  // Unlimited quota. | 
|  | 528       NULL); | 
|  | 529   } | 
|  | 530   return file_system_context_.get(); | 
| 517 } | 531 } | 
| 518 | 532 | 
| 519 quota::QuotaManager* TestingProfile::GetQuotaManager() { | 533 quota::QuotaManager* TestingProfile::GetQuotaManager() { | 
| 520   return NULL; | 534   if (!quota_manager_) { | 
|  | 535     quota_manager_ = new quota::QuotaManager( | 
|  | 536         IsOffTheRecord(), | 
|  | 537         GetPath(), | 
|  | 538         BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 
|  | 539         BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB)); | 
|  | 540   } | 
|  | 541   return quota_manager_.get(); | 
| 521 } | 542 } | 
| 522 | 543 | 
| 523 BrowserSignin* TestingProfile::GetBrowserSignin() { | 544 BrowserSignin* TestingProfile::GetBrowserSignin() { | 
| 524   return NULL; | 545   return NULL; | 
| 525 } | 546 } | 
| 526 | 547 | 
| 527 bool TestingProfile::HasCreatedDownloadManager() const { | 548 bool TestingProfile::HasCreatedDownloadManager() const { | 
| 528   return false; | 549   return false; | 
| 529 } | 550 } | 
| 530 | 551 | 
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 773 } | 794 } | 
| 774 | 795 | 
| 775 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) | 796 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) | 
| 776     : original_profile_(profile) {} | 797     : original_profile_(profile) {} | 
| 777 | 798 | 
| 778 DerivedTestingProfile::~DerivedTestingProfile() {} | 799 DerivedTestingProfile::~DerivedTestingProfile() {} | 
| 779 | 800 | 
| 780 ProfileId DerivedTestingProfile::GetRuntimeId() { | 801 ProfileId DerivedTestingProfile::GetRuntimeId() { | 
| 781   return original_profile_->GetRuntimeId(); | 802   return original_profile_->GetRuntimeId(); | 
| 782 } | 803 } | 
| OLD | NEW | 
|---|