Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: components/autofill/content/browser/wallet/real_pan_wallet_client_unittest.cc

Issue 1144153004: components: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/thread_task_runner_handle.h"
6 #include "components/autofill/core/browser/autofill_test_utils.h" 7 #include "components/autofill/core/browser/autofill_test_utils.h"
7 #include "components/autofill/core/browser/wallet/real_pan_wallet_client.h" 8 #include "components/autofill/core/browser/wallet/real_pan_wallet_client.h"
8 #include "components/autofill/core/common/autofill_switches.h" 9 #include "components/autofill/core/common/autofill_switches.h"
9 #include "content/public/test/test_browser_thread_bundle.h" 10 #include "content/public/test/test_browser_thread_bundle.h"
10 #include "google_apis/gaia/fake_identity_provider.h" 11 #include "google_apis/gaia/fake_identity_provider.h"
11 #include "google_apis/gaia/fake_oauth2_token_service.h" 12 #include "google_apis/gaia/fake_oauth2_token_service.h"
12 #include "net/url_request/test_url_fetcher_factory.h" 13 #include "net/url_request/test_url_fetcher_factory.h"
13 #include "net/url_request/url_request_test_util.h" 14 #include "net/url_request/url_request_test_util.h"
14 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
15 16
16 namespace autofill { 17 namespace autofill {
17 namespace wallet { 18 namespace wallet {
18 19
19 class RealPanWalletClientTest : public testing::Test, 20 class RealPanWalletClientTest : public testing::Test,
20 public RealPanWalletClient::Delegate { 21 public RealPanWalletClient::Delegate {
21 public: 22 public:
22 RealPanWalletClientTest() : result_(AutofillClient::SUCCESS) {} 23 RealPanWalletClientTest() : result_(AutofillClient::SUCCESS) {}
23 ~RealPanWalletClientTest() override {} 24 ~RealPanWalletClientTest() override {}
24 25
25 void SetUp() override { 26 void SetUp() override {
26 // Silence the warning for mismatching sync and wallet servers. 27 // Silence the warning for mismatching sync and wallet servers.
27 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( 28 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
28 switches::kWalletServiceUseSandbox, "0"); 29 switches::kWalletServiceUseSandbox, "0");
29 30
30 request_context_ = new net::TestURLRequestContextGetter( 31 request_context_ = new net::TestURLRequestContextGetter(
31 base::MessageLoopProxy::current()); 32 base::ThreadTaskRunnerHandle::Get());
32 token_service_.reset(new FakeOAuth2TokenService()); 33 token_service_.reset(new FakeOAuth2TokenService());
33 identity_provider_.reset(new FakeIdentityProvider(token_service_.get())); 34 identity_provider_.reset(new FakeIdentityProvider(token_service_.get()));
34 client_.reset(new RealPanWalletClient(request_context_.get(), this)); 35 client_.reset(new RealPanWalletClient(request_context_.get(), this));
35 } 36 }
36 37
37 void TearDown() override { client_.reset(); } 38 void TearDown() override { client_.reset(); }
38 39
39 // RealPanWalletClient::Delegate 40 // RealPanWalletClient::Delegate
40 41
41 IdentityProvider* GetIdentityProvider() override { 42 IdentityProvider* GetIdentityProvider() override {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 TEST_F(RealPanWalletClientTest, OtherError) { 188 TEST_F(RealPanWalletClientTest, OtherError) {
188 StartUnmasking(); 189 StartUnmasking();
189 IssueOAuthToken(); 190 IssueOAuthToken();
190 ReturnResponse(net::HTTP_FORBIDDEN, std::string()); 191 ReturnResponse(net::HTTP_FORBIDDEN, std::string());
191 EXPECT_EQ(AutofillClient::PERMANENT_FAILURE, result_); 192 EXPECT_EQ(AutofillClient::PERMANENT_FAILURE, result_);
192 EXPECT_EQ("", real_pan_); 193 EXPECT_EQ("", real_pan_);
193 } 194 }
194 195
195 } // namespace autofill 196 } // namespace autofill
196 } // namespace wallet 197 } // namespace wallet
OLDNEW
« no previous file with comments | « components/audio_modem/audio_player_unittest.cc ('k') | components/autofill/content/browser/wallet/wallet_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698