| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/autofill/content/browser/wallet/wallet_signin_helper.h" | 5 #include "components/autofill/content/browser/wallet/wallet_signin_helper.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "testing/gmock/include/gmock/gmock.h" | 27 #include "testing/gmock/include/gmock/gmock.h" |
| 28 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
| 29 | 29 |
| 30 using testing::_; | 30 using testing::_; |
| 31 | 31 |
| 32 namespace autofill { | 32 namespace autofill { |
| 33 namespace wallet { | 33 namespace wallet { |
| 34 | 34 |
| 35 namespace { | 35 namespace { |
| 36 | 36 |
| 37 const char kGetTokenPairValidResponse[] = | |
| 38 "{" | |
| 39 " \"refresh_token\": \"rt1\"," | |
| 40 " \"access_token\": \"at1\"," | |
| 41 " \"expires_in\": 3600," | |
| 42 " \"token_type\": \"Bearer\"" | |
| 43 "}"; | |
| 44 | |
| 45 const char kGetAccountInfoValidResponseFormat[] = | 37 const char kGetAccountInfoValidResponseFormat[] = |
| 46 "{\"user_info\":[" | 38 "{\"user_info\":[" |
| 47 " {" | 39 " {" |
| 48 " \"email\": \"%s\"" | 40 " \"email\": \"%s\"" |
| 49 " }" | 41 " }" |
| 50 "]}"; | 42 "]}"; |
| 51 | 43 |
| 52 class MockWalletSigninHelperDelegate : public WalletSigninHelperDelegate { | 44 class MockWalletSigninHelperDelegate : public WalletSigninHelperDelegate { |
| 53 public: | 45 public: |
| 54 MOCK_METHOD1(OnPassiveSigninSuccess, void(const std::string& username)); | 46 MOCK_METHOD1(OnPassiveSigninSuccess, void(const std::string& username)); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 browser_context_.GetRequestContext()->GetURLRequestContext() | 228 browser_context_.GetRequestContext()->GetURLRequestContext() |
| 237 ->set_cookie_store(cookie_monster); | 229 ->set_cookie_store(cookie_monster); |
| 238 signin_helper_->StartWalletCookieValueFetch(); | 230 signin_helper_->StartWalletCookieValueFetch(); |
| 239 base::RunLoop().RunUntilIdle(); | 231 base::RunLoop().RunUntilIdle(); |
| 240 } | 232 } |
| 241 | 233 |
| 242 // TODO(aruslan): http://crbug.com/188317 Need more tests. | 234 // TODO(aruslan): http://crbug.com/188317 Need more tests. |
| 243 | 235 |
| 244 } // namespace wallet | 236 } // namespace wallet |
| 245 } // namespace autofill | 237 } // namespace autofill |
| OLD | NEW |