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

Unified Diff: components/autofill/content/browser/wallet/wallet_service_url_unittest.cc

Issue 25127002: Use production Wallet service URL by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/content/browser/wallet/wallet_service_url_unittest.cc
diff --git a/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc b/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc
index 3ed3600fc0a6f4dbcd6d64d2f49372b657884271..b028a15ce9eb1c6d8706af0364dcd98b289d353e 100644
--- a/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc
+++ b/components/autofill/content/browser/wallet/wallet_service_url_unittest.cc
@@ -12,9 +12,11 @@ namespace autofill {
namespace wallet {
TEST(WalletServiceUrl, CheckDefaultUrls) {
+#if defined(OS_MACOSX)
+ // Default on Mac (for now) is to use sandbox servers.
EXPECT_EQ("https://payments-form-dogfood.sandbox.google.com/online/v2/wallet/"
- "autocheckout/v1/getWalletItemsJwtless",
- GetGetWalletItemsUrl().spec());
+ "autocheckout/v1/getWalletItemsJwtless",
+ GetGetWalletItemsUrl().spec());
EXPECT_EQ("https://wallet-web.sandbox.google.com/online-secure/v2/"
"autocheckout/v1/getFullWalletJwtless?s7e=otp",
GetGetFullWalletUrl().spec());
@@ -40,21 +42,57 @@ TEST(WalletServiceUrl, CheckDefaultUrls) {
EXPECT_EQ("https://payments-form-dogfood.sandbox.google.com/online/v2/"
"passiveauth?isChromePayments=true",
GetPassiveAuthUrl().spec());
+#else
+ EXPECT_EQ("https://wallet.google.com/online/v2/wallet/"
+ "autocheckout/v1/getWalletItemsJwtless",
+ GetGetWalletItemsUrl().spec());
+ EXPECT_EQ("https://wallet.google.com/online-secure/v2/"
+ "autocheckout/v1/getFullWalletJwtless?s7e=otp",
+ GetGetFullWalletUrl().spec());
+ EXPECT_EQ("https://wallet.google.com/manage/paymentMethods",
+ GetManageInstrumentsUrl().spec());
+ EXPECT_EQ("https://wallet.google.com/manage/settings/addresses",
+ GetManageAddressesUrl().spec());
+ EXPECT_EQ("https://wallet.google.com/online/v2/wallet/"
+ "autocheckout/v1/acceptLegalDocument",
+ GetAcceptLegalDocumentsUrl().spec());
+ EXPECT_EQ("https://wallet.google.com/online-secure/v2/"
+ "autocheckout/v1/authenticateInstrument?s7e=cvn",
+ GetAuthenticateInstrumentUrl().spec());
+ EXPECT_EQ("https://wallet.google.com/online/v2/wallet/"
+ "autocheckout/v1/reportStatus",
+ GetSendStatusUrl().spec());
+ EXPECT_EQ("https://wallet.google.com/online/v2/wallet/"
+ "autocheckout/v1/saveToWallet",
+ GetSaveToWalletNoEscrowUrl().spec());
+ EXPECT_EQ("https://wallet.google.com/online-secure/v2/"
+ "autocheckout/v1/saveToWallet?s7e=card_number%3Bcvn",
+ GetSaveToWalletUrl().spec());
+ EXPECT_EQ("https://wallet.google.com/online/v2/"
+ "passiveauth?isChromePayments=true",
+ GetPassiveAuthUrl().spec());
+#endif
}
TEST(WalletServiceUrl, IsUsingProd) {
- // The sandbox servers are the default (for now). Update if this changes.
+#if defined(OS_MACOSX)
EXPECT_FALSE(IsUsingProd());
-
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- command_line->AppendSwitch(switches::kWalletServiceUseProd);
+#else
EXPECT_TRUE(IsUsingProd());
+#endif
- const GURL prod_get_items_url = GetGetWalletItemsUrl();
- command_line->AppendSwitchASCII(switches::kWalletServiceUrl, "http://goo.gl");
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ command_line->AppendSwitchASCII(switches::kWalletServiceUseSandbox, "1");
EXPECT_FALSE(IsUsingProd());
- ASSERT_NE(prod_get_items_url, GetGetWalletItemsUrl());
+ const GURL sandbox_get_items_url = GetGetWalletItemsUrl();
+ const GURL fake_service_url = GURL("http://goo.gl");
+ command_line->AppendSwitchASCII(switches::kWalletServiceUrl,
+ fake_service_url.spec());
+
+ const GURL flag_get_items_url = GetGetWalletItemsUrl();
+ ASSERT_NE(sandbox_get_items_url, flag_get_items_url);
+ EXPECT_EQ(fake_service_url.GetOrigin(), flag_get_items_url.GetOrigin());
}
} // namespace wallet
« no previous file with comments | « components/autofill/content/browser/wallet/wallet_service_url.cc ('k') | components/autofill/core/common/autofill_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698