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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 ~QuittingHistoryDBTask() override {} | 156 ~QuittingHistoryDBTask() override {} |
156 | 157 |
157 DISALLOW_COPY_AND_ASSIGN(QuittingHistoryDBTask); | 158 DISALLOW_COPY_AND_ASSIGN(QuittingHistoryDBTask); |
158 }; | 159 }; |
159 | 160 |
160 class TestExtensionURLRequestContext : public net::URLRequestContext { | 161 class TestExtensionURLRequestContext : public net::URLRequestContext { |
161 public: | 162 public: |
162 TestExtensionURLRequestContext() { | 163 TestExtensionURLRequestContext() { |
163 content::CookieStoreConfig cookie_config; | 164 content::CookieStoreConfig cookie_config; |
164 cookie_config.cookieable_schemes.push_back(extensions::kExtensionScheme); | 165 cookie_config.cookieable_schemes.push_back(extensions::kExtensionScheme); |
165 set_cookie_store(content::CreateCookieStore(cookie_config)); | 166 cookie_store_ = content::CreateCookieStore(cookie_config); |
| 167 set_cookie_store(cookie_store_.get()); |
166 } | 168 } |
167 | 169 |
| 170 scoped_ptr<net::CookieStore> cookie_store_; |
| 171 |
168 ~TestExtensionURLRequestContext() override { AssertNoURLRequests(); } | 172 ~TestExtensionURLRequestContext() override { AssertNoURLRequests(); } |
169 }; | 173 }; |
170 | 174 |
171 class TestExtensionURLRequestContextGetter | 175 class TestExtensionURLRequestContextGetter |
172 : public net::URLRequestContextGetter { | 176 : public net::URLRequestContextGetter { |
173 public: | 177 public: |
174 net::URLRequestContext* GetURLRequestContext() override { | 178 net::URLRequestContext* GetURLRequestContext() override { |
175 if (!context_.get()) | 179 if (!context_.get()) |
176 context_.reset(new TestExtensionURLRequestContext()); | 180 context_.reset(new TestExtensionURLRequestContext()); |
177 return context_.get(); | 181 return context_.get(); |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 // Note: Owned by |original_profile|. | 1056 // Note: Owned by |original_profile|. |
1053 return new TestingProfile(path_, delegate_, | 1057 return new TestingProfile(path_, delegate_, |
1054 #if defined(ENABLE_EXTENSIONS) | 1058 #if defined(ENABLE_EXTENSIONS) |
1055 extension_policy_, | 1059 extension_policy_, |
1056 #endif | 1060 #endif |
1057 std::move(pref_service_), original_profile, | 1061 std::move(pref_service_), original_profile, |
1058 guest_session_, supervised_user_id_, | 1062 guest_session_, supervised_user_id_, |
1059 std::move(policy_service_), testing_factories_, | 1063 std::move(policy_service_), testing_factories_, |
1060 profile_name_); | 1064 profile_name_); |
1061 } | 1065 } |
OLD | NEW |