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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 kCookieValue2, | 121 kCookieValue2, |
122 kChannelIDPrivateKey2, | 122 kChannelIDPrivateKey2, |
123 kChannelIDCert2); | 123 kChannelIDCert2); |
124 } | 124 } |
125 | 125 |
126 void ProfileAuthDataTest::Transfer( | 126 void ProfileAuthDataTest::Transfer( |
127 bool transfer_auth_cookies_and_channel_ids_on_first_login, | 127 bool transfer_auth_cookies_and_channel_ids_on_first_login, |
128 bool transfer_saml_auth_cookies_on_subsequent_login) { | 128 bool transfer_saml_auth_cookies_on_subsequent_login) { |
129 base::RunLoop run_loop; | 129 base::RunLoop run_loop; |
130 ProfileAuthData::Transfer( | 130 ProfileAuthData::Transfer( |
131 &login_browser_context_, | 131 login_browser_context_.GetRequestContext(), |
132 &user_browser_context_, | 132 user_browser_context_.GetRequestContext(), |
133 transfer_auth_cookies_and_channel_ids_on_first_login, | 133 transfer_auth_cookies_and_channel_ids_on_first_login, |
134 transfer_saml_auth_cookies_on_subsequent_login, | 134 transfer_saml_auth_cookies_on_subsequent_login, |
135 run_loop.QuitClosure()); | 135 run_loop.QuitClosure()); |
136 run_loop.Run(); | 136 run_loop.Run(); |
137 if (!transfer_auth_cookies_and_channel_ids_on_first_login && | 137 if (!transfer_auth_cookies_and_channel_ids_on_first_login && |
138 !transfer_saml_auth_cookies_on_subsequent_login) { | 138 !transfer_saml_auth_cookies_on_subsequent_login) { |
139 // When only proxy auth state is being transferred, the completion callback | 139 // When only proxy auth state is being transferred, the completion callback |
140 // is invoked before the transfer has actually completed. Spin the loop once | 140 // is invoked before the transfer has actually completed. Spin the loop once |
141 // more to allow the transfer to complete. | 141 // more to allow the transfer to complete. |
142 base::RunLoop().RunUntilIdle(); | 142 base::RunLoop().RunUntilIdle(); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 PopulateUserBrowserContext(); | 319 PopulateUserBrowserContext(); |
320 | 320 |
321 Transfer(false, true); | 321 Transfer(false, true); |
322 | 322 |
323 VerifyTransferredUserProxyAuthEntry(); | 323 VerifyTransferredUserProxyAuthEntry(); |
324 VerifyUserCookies(kCookieValue2, kCookieValue1); | 324 VerifyUserCookies(kCookieValue2, kCookieValue1); |
325 VerifyUserChannelID(kChannelIDPrivateKey2, kChannelIDCert2); | 325 VerifyUserChannelID(kChannelIDPrivateKey2, kChannelIDCert2); |
326 } | 326 } |
327 | 327 |
328 } // namespace chromeos | 328 } // namespace chromeos |
OLD | NEW |