OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/chromeos/login/profile_auth_data.h" | 5 #include "chrome/browser/chromeos/login/profile_auth_data.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "chrome/test/base/testing_profile.h" | 19 #include "chrome/test/base/testing_profile.h" |
20 #include "content/public/browser/browser_context.h" | 20 #include "content/public/browser/browser_context.h" |
21 #include "content/public/browser/storage_partition.h" | |
22 #include "content/public/test/test_browser_thread_bundle.h" | 21 #include "content/public/test/test_browser_thread_bundle.h" |
23 #include "net/cookies/canonical_cookie.h" | 22 #include "net/cookies/canonical_cookie.h" |
24 #include "net/cookies/cookie_constants.h" | 23 #include "net/cookies/cookie_constants.h" |
25 #include "net/cookies/cookie_store.h" | 24 #include "net/cookies/cookie_store.h" |
26 #include "net/http/http_auth.h" | 25 #include "net/http/http_auth.h" |
27 #include "net/http/http_auth_cache.h" | 26 #include "net/http/http_auth_cache.h" |
28 #include "net/http/http_network_session.h" | 27 #include "net/http/http_network_session.h" |
29 #include "net/http/http_transaction_factory.h" | 28 #include "net/http/http_transaction_factory.h" |
30 #include "net/ssl/channel_id_service.h" | 29 #include "net/ssl/channel_id_service.h" |
31 #include "net/ssl/channel_id_store.h" | 30 #include "net/ssl/channel_id_store.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 net::CookieStore::SetCookiesCallback()); | 232 net::CookieStore::SetCookiesCallback()); |
234 | 233 |
235 GetChannelIDs(browser_context) | 234 GetChannelIDs(browser_context) |
236 ->SetChannelID(base::WrapUnique(new net::ChannelIDStore::ChannelID( | 235 ->SetChannelID(base::WrapUnique(new net::ChannelIDStore::ChannelID( |
237 kChannelIDServerIdentifier, base::Time(), | 236 kChannelIDServerIdentifier, base::Time(), |
238 std::move(channel_id_key)))); | 237 std::move(channel_id_key)))); |
239 } | 238 } |
240 | 239 |
241 net::URLRequestContext* ProfileAuthDataTest::GetRequestContext( | 240 net::URLRequestContext* ProfileAuthDataTest::GetRequestContext( |
242 content::BrowserContext* browser_context) { | 241 content::BrowserContext* browser_context) { |
243 return content::BrowserContext::GetDefaultStoragePartition(browser_context)-> | 242 return browser_context->GetRequestContext()->GetURLRequestContext(); |
244 GetURLRequestContext()->GetURLRequestContext(); | |
245 } | 243 } |
246 | 244 |
247 net::HttpAuthCache* ProfileAuthDataTest::GetProxyAuth( | 245 net::HttpAuthCache* ProfileAuthDataTest::GetProxyAuth( |
248 content::BrowserContext* browser_context) { | 246 content::BrowserContext* browser_context) { |
249 return GetRequestContext(browser_context)->http_transaction_factory()-> | 247 return GetRequestContext(browser_context)->http_transaction_factory()-> |
250 GetSession()->http_auth_cache(); | 248 GetSession()->http_auth_cache(); |
251 } | 249 } |
252 | 250 |
253 net::CookieStore* ProfileAuthDataTest::GetCookies( | 251 net::CookieStore* ProfileAuthDataTest::GetCookies( |
254 content::BrowserContext* browser_context) { | 252 content::BrowserContext* browser_context) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 PopulateUserBrowserContext(); | 316 PopulateUserBrowserContext(); |
319 | 317 |
320 Transfer(false, true); | 318 Transfer(false, true); |
321 | 319 |
322 VerifyTransferredUserProxyAuthEntry(); | 320 VerifyTransferredUserProxyAuthEntry(); |
323 VerifyUserCookies(kCookieValue2, kCookieValue1); | 321 VerifyUserCookies(kCookieValue2, kCookieValue1); |
324 VerifyUserChannelID(channel_id_key2_.get()); | 322 VerifyUserChannelID(channel_id_key2_.get()); |
325 } | 323 } |
326 | 324 |
327 } // namespace chromeos | 325 } // namespace chromeos |
OLD | NEW |