OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/logging.h" | 5 #include "base/logging.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "chrome/browser/autofill/wallet/cart.h" | 9 #include "chrome/browser/autofill/wallet/cart.h" |
10 #include "chrome/browser/autofill/wallet/full_wallet.h" | 10 #include "chrome/browser/autofill/wallet/full_wallet.h" |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 "google_transaction_id", | 799 "google_transaction_id", |
800 &observer); | 800 &observer); |
801 net::TestURLFetcher* fetcher = factory.GetFetcherByID(0); | 801 net::TestURLFetcher* fetcher = factory.GetFetcherByID(0); |
802 ASSERT_TRUE(fetcher); | 802 ASSERT_TRUE(fetcher); |
803 EXPECT_EQ(kSendAutocheckoutStatusOfFailureValidRequest, | 803 EXPECT_EQ(kSendAutocheckoutStatusOfFailureValidRequest, |
804 fetcher->upload_data()); | 804 fetcher->upload_data()); |
805 fetcher->set_response_code(net::HTTP_OK); | 805 fetcher->set_response_code(net::HTTP_OK); |
806 fetcher->delegate()->OnURLFetchComplete(fetcher); | 806 fetcher->delegate()->OnURLFetchComplete(fetcher); |
807 } | 807 } |
808 | 808 |
| 809 TEST_F(WalletClientTest, HasRequestInProgress) { |
| 810 MockWalletClientObserver observer; |
| 811 net::TestURLFetcherFactory factory; |
| 812 |
| 813 WalletClient wallet_client(profile_.GetRequestContext()); |
| 814 EXPECT_FALSE(wallet_client.HasRequestInProgress()); |
| 815 |
| 816 wallet_client.GetWalletItems(&observer); |
| 817 EXPECT_TRUE(wallet_client.HasRequestInProgress()); |
| 818 |
| 819 net::TestURLFetcher* fetcher = factory.GetFetcherByID(0); |
| 820 ASSERT_TRUE(fetcher); |
| 821 fetcher->set_response_code(net::HTTP_OK); |
| 822 fetcher->SetResponseString(kGetWalletItemsValidResponse); |
| 823 fetcher->delegate()->OnURLFetchComplete(fetcher); |
| 824 EXPECT_FALSE(wallet_client.HasRequestInProgress()); |
| 825 } |
| 826 |
809 } // namespace wallet | 827 } // namespace wallet |
810 | 828 |
OLD | NEW |