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 "content/public/common/content_switches.h" | 8 #include "content/public/common/content_switches.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 "online/v2/u/0/passiveauth?isChromePayments=true&authuser=yolo"; | 131 "online/v2/u/0/passiveauth?isChromePayments=true&authuser=yolo"; |
132 EXPECT_TRUE(IsSignInContinueUrl(GURL(sign_in_url_bad_user), &user_index)); | 132 EXPECT_TRUE(IsSignInContinueUrl(GURL(sign_in_url_bad_user), &user_index)); |
133 EXPECT_EQ(0U, user_index); | 133 EXPECT_EQ(0U, user_index); |
134 | 134 |
135 const char not_a_sign_in_url[] = "https://wallet-web.sandbox.google.com/" | 135 const char not_a_sign_in_url[] = "https://wallet-web.sandbox.google.com/" |
136 "online/v2/u/0/example"; | 136 "online/v2/u/0/example"; |
137 EXPECT_FALSE(IsSignInContinueUrl(GURL(not_a_sign_in_url), &user_index)); | 137 EXPECT_FALSE(IsSignInContinueUrl(GURL(not_a_sign_in_url), &user_index)); |
138 } | 138 } |
139 | 139 |
140 TEST(WalletServiceUrl, IsSignInRelatedUrl) { | 140 TEST(WalletServiceUrl, IsSignInRelatedUrl) { |
141 EXPECT_TRUE(IsSignInRelatedUrl(GetSignInUrl())); | 141 EXPECT_TRUE(IsSignInRelatedUrl(GetSignInUrl(0))); |
| 142 EXPECT_TRUE(IsSignInRelatedUrl(GetAddAccountUrl())); |
142 EXPECT_TRUE(IsSignInRelatedUrl(GURL("https://accounts.youtube.com"))); | 143 EXPECT_TRUE(IsSignInRelatedUrl(GURL("https://accounts.youtube.com"))); |
143 EXPECT_TRUE(IsSignInRelatedUrl(GURL("https://accounts.youtube.com/"))); | 144 EXPECT_TRUE(IsSignInRelatedUrl(GURL("https://accounts.youtube.com/"))); |
144 EXPECT_TRUE(IsSignInRelatedUrl(GURL("https://accounts.google.com"))); | 145 EXPECT_TRUE(IsSignInRelatedUrl(GURL("https://accounts.google.com"))); |
145 EXPECT_FALSE(IsSignInRelatedUrl(GURL("http://google.com"))); | 146 EXPECT_FALSE(IsSignInRelatedUrl(GURL("http://google.com"))); |
146 } | 147 } |
147 | 148 |
148 } // namespace wallet | 149 } // namespace wallet |
149 } // namespace autofill | 150 } // namespace autofill |
OLD | NEW |