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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 testing::StrictMock<MockAutofillMetrics> metric_logger_; | 743 testing::StrictMock<MockAutofillMetrics> metric_logger_; |
744 }; | 744 }; |
745 | 745 |
746 } // namespace | 746 } // namespace |
747 | 747 |
748 class WalletClientTest : public testing::Test { | 748 class WalletClientTest : public testing::Test { |
749 public: | 749 public: |
750 WalletClientTest() | 750 WalletClientTest() |
751 : request_context_(new net::TestURLRequestContextGetter( | 751 : request_context_(new net::TestURLRequestContextGetter( |
752 base::MessageLoopProxy::current())) {} | 752 base::MessageLoopProxy::current())) {} |
753 virtual ~WalletClientTest() {} | 753 ~WalletClientTest() override {} |
754 | 754 |
755 virtual void SetUp() override { | 755 void SetUp() override { |
756 wallet_client_.reset(new WalletClient( | 756 wallet_client_.reset(new WalletClient( |
757 request_context_.get(), &delegate_, GURL(kMerchantUrl))); | 757 request_context_.get(), &delegate_, GURL(kMerchantUrl))); |
758 } | 758 } |
759 | 759 |
760 virtual void TearDown() override { | 760 void TearDown() override { wallet_client_.reset(); } |
761 wallet_client_.reset(); | |
762 } | |
763 | 761 |
764 void VerifyAndFinishRequest(net::HttpStatusCode response_code, | 762 void VerifyAndFinishRequest(net::HttpStatusCode response_code, |
765 const std::string& request_body, | 763 const std::string& request_body, |
766 const std::string& response_body) { | 764 const std::string& response_body) { |
767 net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0); | 765 net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0); |
768 ASSERT_TRUE(fetcher); | 766 ASSERT_TRUE(fetcher); |
769 | 767 |
770 const std::string& upload_data = fetcher->upload_data(); | 768 const std::string& upload_data = fetcher->upload_data(); |
771 EXPECT_EQ(request_body, GetData(upload_data)); | 769 EXPECT_EQ(request_body, GetData(upload_data)); |
772 net::HttpRequestHeaders request_headers; | 770 net::HttpRequestHeaders request_headers; |
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1862 delegate_.ExpectBaselineMetrics(); | 1860 delegate_.ExpectBaselineMetrics(); |
1863 | 1861 |
1864 wallet_client_->GetWalletItems(base::string16(), base::string16()); | 1862 wallet_client_->GetWalletItems(base::string16(), base::string16()); |
1865 EXPECT_TRUE(wallet_client_->HasRequestInProgress()); | 1863 EXPECT_TRUE(wallet_client_->HasRequestInProgress()); |
1866 wallet_client_->CancelRequest(); | 1864 wallet_client_->CancelRequest(); |
1867 EXPECT_FALSE(wallet_client_->HasRequestInProgress()); | 1865 EXPECT_FALSE(wallet_client_->HasRequestInProgress()); |
1868 } | 1866 } |
1869 | 1867 |
1870 } // namespace wallet | 1868 } // namespace wallet |
1871 } // namespace autofill | 1869 } // namespace autofill |
OLD | NEW |