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" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::MessageLoopProxy::current())) {} |
55 virtual ~WalletSigninHelperTest() {} | 55 virtual ~WalletSigninHelperTest() {} |
56 | 56 |
57 virtual void SetUp() OVERRIDE { | 57 virtual 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 virtual void TearDown() OVERRIDE { | 62 virtual void TearDown() override { |
63 signin_helper_.reset(); | 63 signin_helper_.reset(); |
64 } | 64 } |
65 | 65 |
66 // Sets up a response for the mock URLFetcher and completes the request. | 66 // Sets up a response for the mock URLFetcher and completes the request. |
67 void SetUpFetcherResponseAndCompleteRequest( | 67 void SetUpFetcherResponseAndCompleteRequest( |
68 const std::string& url, | 68 const std::string& url, |
69 int response_code, | 69 int response_code, |
70 const net::ResponseCookies& cookies, | 70 const net::ResponseCookies& cookies, |
71 const std::string& response_string) { | 71 const std::string& response_string) { |
72 net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0); | 72 net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 request_context_->GetURLRequestContext() | 170 request_context_->GetURLRequestContext() |
171 ->set_cookie_store(cookie_monster); | 171 ->set_cookie_store(cookie_monster); |
172 signin_helper_->StartWalletCookieValueFetch(); | 172 signin_helper_->StartWalletCookieValueFetch(); |
173 base::RunLoop().RunUntilIdle(); | 173 base::RunLoop().RunUntilIdle(); |
174 } | 174 } |
175 | 175 |
176 // TODO(aruslan): http://crbug.com/188317 Need more tests. | 176 // TODO(aruslan): http://crbug.com/188317 Need more tests. |
177 | 177 |
178 } // namespace wallet | 178 } // namespace wallet |
179 } // namespace autofill | 179 } // namespace autofill |
OLD | NEW |