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

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

Issue 663643002: requestAutocomplete (desktop): don't get stuck in infinite loop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 6 years, 2 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
« no previous file with comments | « components/autofill/content/browser/wallet/wallet_service_url.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
OLDNEW
« no previous file with comments | « components/autofill/content/browser/wallet/wallet_service_url.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698