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 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 TestingProfile login_browser_context_; | 103 TestingProfile login_browser_context_; |
104 TestingProfile user_browser_context_; | 104 TestingProfile user_browser_context_; |
105 | 105 |
106 net::CookieList user_cookie_list_; | 106 net::CookieList user_cookie_list_; |
107 net::ChannelIDStore::ChannelIDList user_channel_id_list_; | 107 net::ChannelIDStore::ChannelIDList user_channel_id_list_; |
108 | 108 |
109 std::unique_ptr<base::RunLoop> run_loop_; | 109 std::unique_ptr<base::RunLoop> run_loop_; |
110 }; | 110 }; |
111 | 111 |
112 void ProfileAuthDataTest::SetUp() { | 112 void ProfileAuthDataTest::SetUp() { |
113 channel_id_key1_.reset(crypto::ECPrivateKey::Create()); | 113 channel_id_key1_ = crypto::ECPrivateKey::Create(); |
114 channel_id_key2_.reset(crypto::ECPrivateKey::Create()); | 114 channel_id_key2_ = crypto::ECPrivateKey::Create(); |
115 PopulateBrowserContext(&login_browser_context_, kProxyAuthPassword1, | 115 PopulateBrowserContext(&login_browser_context_, kProxyAuthPassword1, |
116 kCookieValue1, | 116 kCookieValue1, channel_id_key1_->Copy()); |
117 base::WrapUnique(channel_id_key1_->Copy())); | |
118 } | 117 } |
119 | 118 |
120 void ProfileAuthDataTest::PopulateUserBrowserContext() { | 119 void ProfileAuthDataTest::PopulateUserBrowserContext() { |
121 PopulateBrowserContext(&user_browser_context_, kProxyAuthPassword2, | 120 PopulateBrowserContext(&user_browser_context_, kProxyAuthPassword2, |
122 kCookieValue2, | 121 kCookieValue2, channel_id_key2_->Copy()); |
123 base::WrapUnique(channel_id_key2_->Copy())); | |
124 } | 122 } |
125 | 123 |
126 void ProfileAuthDataTest::Transfer( | 124 void ProfileAuthDataTest::Transfer( |
127 bool transfer_auth_cookies_and_channel_ids_on_first_login, | 125 bool transfer_auth_cookies_and_channel_ids_on_first_login, |
128 bool transfer_saml_auth_cookies_on_subsequent_login) { | 126 bool transfer_saml_auth_cookies_on_subsequent_login) { |
129 base::RunLoop run_loop; | 127 base::RunLoop run_loop; |
130 ProfileAuthData::Transfer( | 128 ProfileAuthData::Transfer( |
131 login_browser_context_.GetRequestContext(), | 129 login_browser_context_.GetRequestContext(), |
132 user_browser_context_.GetRequestContext(), | 130 user_browser_context_.GetRequestContext(), |
133 transfer_auth_cookies_and_channel_ids_on_first_login, | 131 transfer_auth_cookies_and_channel_ids_on_first_login, |
(...skipping 184 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 |