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/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 "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 GetSaveToWalletNoEscrowUrl(1).spec()); | 74 GetSaveToWalletNoEscrowUrl(1).spec()); |
75 EXPECT_EQ("https://wallet.google.com/online-secure/v2/u/1/" | 75 EXPECT_EQ("https://wallet.google.com/online-secure/v2/u/1/" |
76 "autocheckout/v1/saveToWallet?s7e=card_number%3Bcvn", | 76 "autocheckout/v1/saveToWallet?s7e=card_number%3Bcvn", |
77 GetSaveToWalletUrl(1).spec()); | 77 GetSaveToWalletUrl(1).spec()); |
78 EXPECT_EQ("https://wallet.google.com/online/v2/u/1/" | 78 EXPECT_EQ("https://wallet.google.com/online/v2/u/1/" |
79 "passiveauth?isChromePayments=true", | 79 "passiveauth?isChromePayments=true", |
80 GetPassiveAuthUrl(1).spec()); | 80 GetPassiveAuthUrl(1).spec()); |
81 } | 81 } |
82 | 82 |
83 TEST(WalletServiceUrl, IsUsingProd) { | 83 TEST(WalletServiceUrl, IsUsingProd) { |
84 #if defined(OS_MACOSX) | |
85 EXPECT_FALSE(IsUsingProd()); | |
86 #else | |
87 EXPECT_TRUE(IsUsingProd()); | 84 EXPECT_TRUE(IsUsingProd()); |
88 #endif | |
89 | 85 |
90 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 86 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
91 command_line->AppendSwitchASCII(switches::kWalletServiceUseSandbox, "1"); | 87 command_line->AppendSwitchASCII(switches::kWalletServiceUseSandbox, "1"); |
92 EXPECT_FALSE(IsUsingProd()); | 88 EXPECT_FALSE(IsUsingProd()); |
93 | 89 |
94 const GURL sandbox_get_items_url = GetGetWalletItemsUrl(0); | 90 const GURL sandbox_get_items_url = GetGetWalletItemsUrl(0); |
95 const GURL fake_service_url = GURL("http://goo.gl"); | 91 const GURL fake_service_url = GURL("http://goo.gl"); |
96 command_line->AppendSwitchASCII(switches::kWalletServiceUrl, | 92 command_line->AppendSwitchASCII(switches::kWalletServiceUrl, |
97 fake_service_url.spec()); | 93 fake_service_url.spec()); |
98 | 94 |
(...skipping 27 matching lines...) Expand all Loading... |
126 EXPECT_TRUE(IsSignInContinueUrl(GURL(sign_in_url_bad_user), &user_index)); | 122 EXPECT_TRUE(IsSignInContinueUrl(GURL(sign_in_url_bad_user), &user_index)); |
127 EXPECT_EQ(0U, user_index); | 123 EXPECT_EQ(0U, user_index); |
128 | 124 |
129 const char not_a_sign_in_url[] = "https://wallet-web.sandbox.google.com/" | 125 const char not_a_sign_in_url[] = "https://wallet-web.sandbox.google.com/" |
130 "online/v2/u/0/example"; | 126 "online/v2/u/0/example"; |
131 EXPECT_FALSE(IsSignInContinueUrl(GURL(not_a_sign_in_url), &user_index)); | 127 EXPECT_FALSE(IsSignInContinueUrl(GURL(not_a_sign_in_url), &user_index)); |
132 } | 128 } |
133 | 129 |
134 } // namespace wallet | 130 } // namespace wallet |
135 } // namespace autofill | 131 } // namespace autofill |
OLD | NEW |