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

Side by Side Diff: components/autofill/content/browser/wallet/wallet_service_url_unittest.cc

Issue 17970003: New encryption/escrow endpoints for Wallet (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Dane's review Created 7 years, 5 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 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/command_line.h" 5 #include "base/command_line.h"
6 #include "components/autofill/content/browser/wallet/wallet_service_url.h" 6 #include "components/autofill/content/browser/wallet/wallet_service_url.h"
7 #include "components/autofill/core/common/autofill_switches.h" 7 #include "components/autofill/core/common/autofill_switches.h"
8 #include "googleurl/src/gurl.h" 8 #include "googleurl/src/gurl.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace autofill { 11 namespace autofill {
12 namespace wallet { 12 namespace wallet {
13 13
14 TEST(WalletServiceUrl, CheckDefaultUrls) { 14 TEST(WalletServiceUrl, CheckDefaultUrls) {
15 EXPECT_EQ("https://payments-form-dogfood.sandbox.google.com/online/v2/wallet/" 15 EXPECT_EQ("https://payments-form-dogfood.sandbox.google.com/online/v2/wallet/"
16 "autocheckout/v1/getWalletItemsJwtless", 16 "autocheckout/v1/getWalletItemsJwtless",
17 GetGetWalletItemsUrl().spec()); 17 GetGetWalletItemsUrl().spec());
18 EXPECT_EQ("https://payments-form-dogfood.sandbox.google.com/online/v2/wallet/" 18 EXPECT_EQ("https://wallet-web.sandbox.google.com/online-secure/v2/"
19 "autocheckout/v1/getFullWalletJwtless", 19 "autocheckout/v1/getFullWalletJwtless?s7e=otp",
20 GetGetFullWalletUrl().spec()); 20 GetGetFullWalletUrl().spec());
21 EXPECT_EQ("https://wallet-web.sandbox.google.com/manage/w/0/#paymentMethods:", 21 EXPECT_EQ("https://wallet-web.sandbox.google.com/manage/w/0/#paymentMethods:",
22 GetManageInstrumentsUrl().spec()); 22 GetManageInstrumentsUrl().spec());
23 EXPECT_EQ("https://wallet-web.sandbox.google.com/manage/w/0/" 23 EXPECT_EQ("https://wallet-web.sandbox.google.com/manage/w/0/"
24 "#settings:addresses", 24 "#settings:addresses",
25 GetManageAddressesUrl().spec()); 25 GetManageAddressesUrl().spec());
26 EXPECT_EQ("https://payments-form-dogfood.sandbox.google.com/online/v2/wallet/" 26 EXPECT_EQ("https://payments-form-dogfood.sandbox.google.com/online/v2/wallet/"
27 "autocheckout/v1/acceptLegalDocument", 27 "autocheckout/v1/acceptLegalDocument",
28 GetAcceptLegalDocumentsUrl().spec()); 28 GetAcceptLegalDocumentsUrl().spec());
29 EXPECT_EQ("https://payments-form-dogfood.sandbox.google.com/online/v2/wallet/" 29 EXPECT_EQ("https://wallet-web.sandbox.google.com/online-secure/v2/"
30 "autocheckout/v1/authenticateInstrument", 30 "autocheckout/v1/authenticateInstrument?s7e=cvn",
31 GetAuthenticateInstrumentUrl().spec()); 31 GetAuthenticateInstrumentUrl().spec());
32 EXPECT_EQ("https://payments-form-dogfood.sandbox.google.com/online/v2/wallet/" 32 EXPECT_EQ("https://payments-form-dogfood.sandbox.google.com/online/v2/wallet/"
33 "autocheckout/v1/reportStatus", 33 "autocheckout/v1/reportStatus",
34 GetSendStatusUrl().spec()); 34 GetSendStatusUrl().spec());
35 EXPECT_EQ("https://payments-form-dogfood.sandbox.google.com/online/v2/wallet/" 35 EXPECT_EQ("https://wallet-web.sandbox.google.com/online-secure/v2/"
36 "autocheckout/v1/saveToWallet", 36 "autocheckout/v1/saveToWallet?s7e=card_number%3Bcvn",
37 GetSaveToWalletUrl().spec()); 37 GetSaveToWalletUrl().spec());
38 EXPECT_EQ("https://payments-form-dogfood.sandbox.google.com/online/v2/" 38 EXPECT_EQ("https://payments-form-dogfood.sandbox.google.com/online/v2/"
39 "passiveauth?isChromePayments=true", 39 "passiveauth?isChromePayments=true",
40 GetPassiveAuthUrl().spec()); 40 GetPassiveAuthUrl().spec());
41 EXPECT_EQ("https://wallet-web.sandbox.google.com/online-secure/"
42 "temporarydata/cvv?s7e=cvv",
43 GetEncryptionUrl().spec());
44 EXPECT_EQ("https://wallet-web.sandbox.google.com/checkout/dehEfe?"
45 "s7e=cardNumber%3Bcvv",
46 GetEscrowUrl().spec());
47 } 41 }
48 42
49 TEST(WalletServiceUrl, IsUsingProd) { 43 TEST(WalletServiceUrl, IsUsingProd) {
50 // The sandbox servers are the default (for now). Update if this changes. 44 // The sandbox servers are the default (for now). Update if this changes.
51 EXPECT_FALSE(IsUsingProd()); 45 EXPECT_FALSE(IsUsingProd());
52 46
53 CommandLine* command_line = CommandLine::ForCurrentProcess(); 47 CommandLine* command_line = CommandLine::ForCurrentProcess();
54 command_line->AppendSwitch(switches::kWalletServiceUseProd); 48 command_line->AppendSwitch(switches::kWalletServiceUseProd);
55 EXPECT_TRUE(IsUsingProd()); 49 EXPECT_TRUE(IsUsingProd());
56 50
57 const GURL prod_get_items_url = GetGetWalletItemsUrl(); 51 const GURL prod_get_items_url = GetGetWalletItemsUrl();
58 command_line->AppendSwitchASCII(switches::kWalletServiceUrl, "http://goo.gl"); 52 command_line->AppendSwitchASCII(switches::kWalletServiceUrl, "http://goo.gl");
59 EXPECT_FALSE(IsUsingProd()); 53 EXPECT_FALSE(IsUsingProd());
60 54
61 ASSERT_NE(prod_get_items_url, GetGetWalletItemsUrl()); 55 ASSERT_NE(prod_get_items_url, GetGetWalletItemsUrl());
62 } 56 }
63 57
64 } // namespace wallet 58 } // namespace wallet
65 } // namespace autofill 59 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698