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

Side by Side Diff: chrome/browser/autofill/wallet/wallet_client_unittest.cc

Issue 12221040: Interactive autofill: Handle Online Wallet being unavailable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/autofill/wallet/wallet_client.cc ('k') | chrome/browser/ui/autofill/autofill_dialog_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698