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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #include "content/browser/mock_resource_context.h" | 52 #include "content/browser/mock_resource_context.h" |
53 #include "content/common/notification_service.h" | 53 #include "content/common/notification_service.h" |
54 #include "net/base/cookie_monster.h" | 54 #include "net/base/cookie_monster.h" |
55 #include "net/url_request/url_request_context.h" | 55 #include "net/url_request/url_request_context.h" |
56 #include "net/url_request/url_request_context_getter.h" | 56 #include "net/url_request/url_request_context_getter.h" |
57 #include "net/url_request/url_request_test_util.h" | 57 #include "net/url_request/url_request_test_util.h" |
58 #include "testing/gmock/include/gmock/gmock.h" | 58 #include "testing/gmock/include/gmock/gmock.h" |
59 #include "webkit/database/database_tracker.h" | 59 #include "webkit/database/database_tracker.h" |
60 #include "webkit/fileapi/file_system_context.h" | 60 #include "webkit/fileapi/file_system_context.h" |
61 #include "webkit/quota/quota_manager.h" | 61 #include "webkit/quota/quota_manager.h" |
| 62 #include "webkit/quota/mock_quota_manager.h" |
62 | 63 |
63 using base::Time; | 64 using base::Time; |
64 using testing::NiceMock; | 65 using testing::NiceMock; |
65 using testing::Return; | 66 using testing::Return; |
66 | 67 |
67 namespace { | 68 namespace { |
68 | 69 |
69 // 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 |
70 // for use with BlockUntilHistoryProcessesPendingRequests. | 71 // for use with BlockUntilHistoryProcessesPendingRequests. |
71 | 72 |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 GetPath(), | 538 GetPath(), |
538 IsOffTheRecord(), | 539 IsOffTheRecord(), |
539 true, // Allow file access from files. | 540 true, // Allow file access from files. |
540 true, // Unlimited quota. | 541 true, // Unlimited quota. |
541 NULL); | 542 NULL); |
542 } | 543 } |
543 return file_system_context_.get(); | 544 return file_system_context_.get(); |
544 } | 545 } |
545 | 546 |
546 quota::QuotaManager* TestingProfile::GetQuotaManager() { | 547 quota::QuotaManager* TestingProfile::GetQuotaManager() { |
547 return NULL; | 548 if (!quota_manager_) { |
| 549 quota_manager_ = new quota::MockQuotaManager( |
| 550 IsOffTheRecord(), |
| 551 GetPath(), |
| 552 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
| 553 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), |
| 554 GetExtensionSpecialStoragePolicy()); |
| 555 } |
| 556 return quota_manager_.get(); |
548 } | 557 } |
549 | 558 |
550 BrowserSignin* TestingProfile::GetBrowserSignin() { | 559 BrowserSignin* TestingProfile::GetBrowserSignin() { |
551 return NULL; | 560 return NULL; |
552 } | 561 } |
553 | 562 |
554 bool TestingProfile::HasCreatedDownloadManager() const { | 563 bool TestingProfile::HasCreatedDownloadManager() const { |
555 return false; | 564 return false; |
556 } | 565 } |
557 | 566 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { | 796 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { |
788 return GetExtensionSpecialStoragePolicy(); | 797 return GetExtensionSpecialStoragePolicy(); |
789 } | 798 } |
790 | 799 |
791 void TestingProfile::DestroyWebDataService() { | 800 void TestingProfile::DestroyWebDataService() { |
792 if (!web_data_service_.get()) | 801 if (!web_data_service_.get()) |
793 return; | 802 return; |
794 | 803 |
795 web_data_service_->Shutdown(); | 804 web_data_service_->Shutdown(); |
796 } | 805 } |
OLD | NEW |