OLD | NEW |
---|---|
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 "chrome/test/base/testing_profile.h" | 5 #include "chrome/test/base/testing_profile.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 #include "components/webdata_services/web_data_service_wrapper.h" | 76 #include "components/webdata_services/web_data_service_wrapper.h" |
77 #include "content/public/browser/browser_thread.h" | 77 #include "content/public/browser/browser_thread.h" |
78 #include "content/public/browser/cookie_store_factory.h" | 78 #include "content/public/browser/cookie_store_factory.h" |
79 #include "content/public/browser/notification_service.h" | 79 #include "content/public/browser/notification_service.h" |
80 #include "content/public/browser/render_process_host.h" | 80 #include "content/public/browser/render_process_host.h" |
81 #include "content/public/browser/storage_partition.h" | 81 #include "content/public/browser/storage_partition.h" |
82 #include "content/public/browser/zoom_level_delegate.h" | 82 #include "content/public/browser/zoom_level_delegate.h" |
83 #include "content/public/test/mock_resource_context.h" | 83 #include "content/public/test/mock_resource_context.h" |
84 #include "content/public/test/test_utils.h" | 84 #include "content/public/test/test_utils.h" |
85 #include "extensions/common/constants.h" | 85 #include "extensions/common/constants.h" |
86 #include "net/cookies/cookie_store.h" | |
86 #include "net/url_request/url_request_context.h" | 87 #include "net/url_request/url_request_context.h" |
87 #include "net/url_request/url_request_context_getter.h" | 88 #include "net/url_request/url_request_context_getter.h" |
88 #include "net/url_request/url_request_test_util.h" | 89 #include "net/url_request/url_request_test_util.h" |
89 #include "testing/gmock/include/gmock/gmock.h" | 90 #include "testing/gmock/include/gmock/gmock.h" |
90 | 91 |
91 #if defined(ENABLE_CONFIGURATION_POLICY) | 92 #if defined(ENABLE_CONFIGURATION_POLICY) |
92 #include "chrome/browser/policy/schema_registry_service.h" | 93 #include "chrome/browser/policy/schema_registry_service.h" |
93 #include "chrome/browser/policy/schema_registry_service_factory.h" | 94 #include "chrome/browser/policy/schema_registry_service_factory.h" |
94 #include "components/policy/core/common/configuration_policy_provider.h" | 95 #include "components/policy/core/common/configuration_policy_provider.h" |
95 #include "components/policy/core/common/policy_service_impl.h" | 96 #include "components/policy/core/common/policy_service_impl.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 ~QuittingHistoryDBTask() override {} | 153 ~QuittingHistoryDBTask() override {} |
153 | 154 |
154 DISALLOW_COPY_AND_ASSIGN(QuittingHistoryDBTask); | 155 DISALLOW_COPY_AND_ASSIGN(QuittingHistoryDBTask); |
155 }; | 156 }; |
156 | 157 |
157 class TestExtensionURLRequestContext : public net::URLRequestContext { | 158 class TestExtensionURLRequestContext : public net::URLRequestContext { |
158 public: | 159 public: |
159 TestExtensionURLRequestContext() { | 160 TestExtensionURLRequestContext() { |
160 content::CookieStoreConfig cookie_config; | 161 content::CookieStoreConfig cookie_config; |
161 cookie_config.cookieable_schemes.push_back(extensions::kExtensionScheme); | 162 cookie_config.cookieable_schemes.push_back(extensions::kExtensionScheme); |
162 set_cookie_store(content::CreateCookieStore(cookie_config)); | 163 cookie_store_ = content::CreateCookieStore(cookie_config); |
164 set_cookie_store(cookie_store_.get()); | |
163 } | 165 } |
164 | 166 |
167 scoped_ptr<net::CookieStore> cookie_store_; | |
Randy Smith (Not in Mondays)
2016/03/01 20:48:43
This (anti) pattern of a derived class actually ow
mmenke
2016/03/01 22:44:45
True...Though this isn't a "real" URLRequestContex
| |
168 | |
165 ~TestExtensionURLRequestContext() override { AssertNoURLRequests(); } | 169 ~TestExtensionURLRequestContext() override { AssertNoURLRequests(); } |
166 }; | 170 }; |
167 | 171 |
168 class TestExtensionURLRequestContextGetter | 172 class TestExtensionURLRequestContextGetter |
169 : public net::URLRequestContextGetter { | 173 : public net::URLRequestContextGetter { |
170 public: | 174 public: |
171 net::URLRequestContext* GetURLRequestContext() override { | 175 net::URLRequestContext* GetURLRequestContext() override { |
172 if (!context_.get()) | 176 if (!context_.get()) |
173 context_.reset(new TestExtensionURLRequestContext()); | 177 context_.reset(new TestExtensionURLRequestContext()); |
174 return context_.get(); | 178 return context_.get(); |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1040 | 1044 |
1041 // Note: Owned by |original_profile|. | 1045 // Note: Owned by |original_profile|. |
1042 return new TestingProfile(path_, delegate_, | 1046 return new TestingProfile(path_, delegate_, |
1043 #if defined(ENABLE_EXTENSIONS) | 1047 #if defined(ENABLE_EXTENSIONS) |
1044 extension_policy_, | 1048 extension_policy_, |
1045 #endif | 1049 #endif |
1046 std::move(pref_service_), original_profile, | 1050 std::move(pref_service_), original_profile, |
1047 guest_session_, supervised_user_id_, | 1051 guest_session_, supervised_user_id_, |
1048 std::move(policy_service_), testing_factories_); | 1052 std::move(policy_service_), testing_factories_); |
1049 } | 1053 } |
OLD | NEW |