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/message_loop/message_loop.h" | |
10 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
11 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| 11 #include "base/thread_task_runner_handle.h" |
12 #include "components/autofill/content/browser/wallet/wallet_service_url.h" | 12 #include "components/autofill/content/browser/wallet/wallet_service_url.h" |
13 #include "components/autofill/content/browser/wallet/wallet_signin_helper_delega
te.h" | 13 #include "components/autofill/content/browser/wallet/wallet_signin_helper_delega
te.h" |
14 #include "content/public/browser/cookie_store_factory.h" | 14 #include "content/public/browser/cookie_store_factory.h" |
15 #include "content/public/test/test_browser_thread_bundle.h" | 15 #include "content/public/test/test_browser_thread_bundle.h" |
16 #include "google_apis/gaia/gaia_constants.h" | 16 #include "google_apis/gaia/gaia_constants.h" |
17 #include "google_apis/gaia/gaia_urls.h" | 17 #include "google_apis/gaia/gaia_urls.h" |
18 #include "google_apis/gaia/google_service_auth_error.h" | 18 #include "google_apis/gaia/google_service_auth_error.h" |
19 #include "net/cookies/canonical_cookie.h" | 19 #include "net/cookies/canonical_cookie.h" |
20 #include "net/cookies/cookie_monster.h" | 20 #include "net/cookies/cookie_monster.h" |
21 #include "net/cookies/cookie_options.h" | 21 #include "net/cookies/cookie_options.h" |
(...skipping 22 matching lines...) Expand all Loading... |
44 MOCK_METHOD1(OnDidFetchWalletCookieValue, | 44 MOCK_METHOD1(OnDidFetchWalletCookieValue, |
45 void(const std::string& cookie_value)); | 45 void(const std::string& cookie_value)); |
46 }; | 46 }; |
47 | 47 |
48 } // namespace | 48 } // namespace |
49 | 49 |
50 class WalletSigninHelperTest : public testing::Test { | 50 class WalletSigninHelperTest : public testing::Test { |
51 protected: | 51 protected: |
52 WalletSigninHelperTest() | 52 WalletSigninHelperTest() |
53 : request_context_(new net::TestURLRequestContextGetter( | 53 : request_context_(new net::TestURLRequestContextGetter( |
54 base::MessageLoopProxy::current())) {} | 54 base::ThreadTaskRunnerHandle::Get())) {} |
55 ~WalletSigninHelperTest() override {} | 55 ~WalletSigninHelperTest() override {} |
56 | 56 |
57 void SetUp() override { | 57 void SetUp() override { |
58 signin_helper_.reset( | 58 signin_helper_.reset( |
59 new WalletSigninHelper(&mock_delegate_, request_context_.get())); | 59 new WalletSigninHelper(&mock_delegate_, request_context_.get())); |
60 } | 60 } |
61 | 61 |
62 void TearDown() override { signin_helper_.reset(); } | 62 void TearDown() override { signin_helper_.reset(); } |
63 | 63 |
64 // Sets up a response for the mock URLFetcher and completes the request. | 64 // Sets up a response for the mock URLFetcher and completes the request. |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 request_context_->GetURLRequestContext() | 168 request_context_->GetURLRequestContext() |
169 ->set_cookie_store(cookie_monster); | 169 ->set_cookie_store(cookie_monster); |
170 signin_helper_->StartWalletCookieValueFetch(); | 170 signin_helper_->StartWalletCookieValueFetch(); |
171 base::RunLoop().RunUntilIdle(); | 171 base::RunLoop().RunUntilIdle(); |
172 } | 172 } |
173 | 173 |
174 // TODO(aruslan): http://crbug.com/188317 Need more tests. | 174 // TODO(aruslan): http://crbug.com/188317 Need more tests. |
175 | 175 |
176 } // namespace wallet | 176 } // namespace wallet |
177 } // namespace autofill | 177 } // namespace autofill |
OLD | NEW |