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" |
21 #include "content/public/test/test_browser_thread_bundle.h" | 22 #include "content/public/test/test_browser_thread_bundle.h" |
22 #include "net/cookies/canonical_cookie.h" | 23 #include "net/cookies/canonical_cookie.h" |
23 #include "net/cookies/cookie_constants.h" | 24 #include "net/cookies/cookie_constants.h" |
24 #include "net/cookies/cookie_store.h" | 25 #include "net/cookies/cookie_store.h" |
25 #include "net/http/http_auth.h" | 26 #include "net/http/http_auth.h" |
26 #include "net/http/http_auth_cache.h" | 27 #include "net/http/http_auth_cache.h" |
27 #include "net/http/http_network_session.h" | 28 #include "net/http/http_network_session.h" |
28 #include "net/http/http_transaction_factory.h" | 29 #include "net/http/http_transaction_factory.h" |
29 #include "net/ssl/channel_id_service.h" | 30 #include "net/ssl/channel_id_service.h" |
30 #include "net/ssl/channel_id_store.h" | 31 #include "net/ssl/channel_id_store.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 net::CookieStore::SetCookiesCallback()); | 233 net::CookieStore::SetCookiesCallback()); |
233 | 234 |
234 GetChannelIDs(browser_context) | 235 GetChannelIDs(browser_context) |
235 ->SetChannelID(base::WrapUnique(new net::ChannelIDStore::ChannelID( | 236 ->SetChannelID(base::WrapUnique(new net::ChannelIDStore::ChannelID( |
236 kChannelIDServerIdentifier, base::Time(), | 237 kChannelIDServerIdentifier, base::Time(), |
237 std::move(channel_id_key)))); | 238 std::move(channel_id_key)))); |
238 } | 239 } |
239 | 240 |
240 net::URLRequestContext* ProfileAuthDataTest::GetRequestContext( | 241 net::URLRequestContext* ProfileAuthDataTest::GetRequestContext( |
241 content::BrowserContext* browser_context) { | 242 content::BrowserContext* browser_context) { |
242 return browser_context->GetRequestContext()->GetURLRequestContext(); | 243 return content::BrowserContext::GetDefaultStoragePartition(browser_context)-> |
| 244 GetURLRequestContext()->GetURLRequestContext(); |
243 } | 245 } |
244 | 246 |
245 net::HttpAuthCache* ProfileAuthDataTest::GetProxyAuth( | 247 net::HttpAuthCache* ProfileAuthDataTest::GetProxyAuth( |
246 content::BrowserContext* browser_context) { | 248 content::BrowserContext* browser_context) { |
247 return GetRequestContext(browser_context)->http_transaction_factory()-> | 249 return GetRequestContext(browser_context)->http_transaction_factory()-> |
248 GetSession()->http_auth_cache(); | 250 GetSession()->http_auth_cache(); |
249 } | 251 } |
250 | 252 |
251 net::CookieStore* ProfileAuthDataTest::GetCookies( | 253 net::CookieStore* ProfileAuthDataTest::GetCookies( |
252 content::BrowserContext* browser_context) { | 254 content::BrowserContext* browser_context) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 PopulateUserBrowserContext(); | 318 PopulateUserBrowserContext(); |
317 | 319 |
318 Transfer(false, true); | 320 Transfer(false, true); |
319 | 321 |
320 VerifyTransferredUserProxyAuthEntry(); | 322 VerifyTransferredUserProxyAuthEntry(); |
321 VerifyUserCookies(kCookieValue2, kCookieValue1); | 323 VerifyUserCookies(kCookieValue2, kCookieValue1); |
322 VerifyUserChannelID(channel_id_key2_.get()); | 324 VerifyUserChannelID(channel_id_key2_.get()); |
323 } | 325 } |
324 | 326 |
325 } // namespace chromeos | 327 } // namespace chromeos |
OLD | NEW |