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 "base/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
6 #include "base/json/json_writer.h" | 6 #include "base/json/json_writer.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 } // namespace | 722 } // namespace |
723 | 723 |
724 class WalletClientTest : public testing::Test { | 724 class WalletClientTest : public testing::Test { |
725 public: | 725 public: |
726 WalletClientTest() | 726 WalletClientTest() |
727 : request_context_(new net::TestURLRequestContextGetter( | 727 : request_context_(new net::TestURLRequestContextGetter( |
728 base::MessageLoopProxy::current())) {} | 728 base::MessageLoopProxy::current())) {} |
729 virtual ~WalletClientTest() {} | 729 virtual ~WalletClientTest() {} |
730 | 730 |
731 virtual void SetUp() OVERRIDE { | 731 virtual void SetUp() OVERRIDE { |
732 wallet_client_.reset( | 732 wallet_client_.reset(new WalletClient( |
733 new WalletClient(request_context_, | 733 request_context_.get(), &delegate_, GURL(kMerchantUrl))); |
734 &delegate_, | |
735 GURL(kMerchantUrl))); | |
736 } | 734 } |
737 | 735 |
738 virtual void TearDown() OVERRIDE { | 736 virtual void TearDown() OVERRIDE { |
739 wallet_client_.reset(); | 737 wallet_client_.reset(); |
740 } | 738 } |
741 | 739 |
742 void VerifyAndFinishRequest(net::HttpStatusCode response_code, | 740 void VerifyAndFinishRequest(net::HttpStatusCode response_code, |
743 const std::string& request_body, | 741 const std::string& request_body, |
744 const std::string& response_body) { | 742 const std::string& response_body) { |
745 net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0); | 743 net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0); |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1783 delegate_.ExpectBaselineMetrics(); | 1781 delegate_.ExpectBaselineMetrics(); |
1784 | 1782 |
1785 wallet_client_->GetWalletItems(base::string16(), base::string16()); | 1783 wallet_client_->GetWalletItems(base::string16(), base::string16()); |
1786 EXPECT_TRUE(wallet_client_->HasRequestInProgress()); | 1784 EXPECT_TRUE(wallet_client_->HasRequestInProgress()); |
1787 wallet_client_->CancelRequest(); | 1785 wallet_client_->CancelRequest(); |
1788 EXPECT_FALSE(wallet_client_->HasRequestInProgress()); | 1786 EXPECT_FALSE(wallet_client_->HasRequestInProgress()); |
1789 } | 1787 } |
1790 | 1788 |
1791 } // namespace wallet | 1789 } // namespace wallet |
1792 } // namespace autofill | 1790 } // namespace autofill |
OLD | NEW |