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

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentsValidatorsTest.cpp

Issue 2477883002: [Web Payments] Mojom namespace blink -> payments (Closed)
Patch Set: Fix WebKit tests Created 4 years, 1 month 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 | « third_party/WebKit/Source/modules/payments/PaymentsValidators.cpp ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "modules/payments/PaymentsValidators.h" 5 #include "modules/payments/PaymentsValidators.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "wtf/text/WTFString.h" 8 #include "wtf/text/WTFString.h"
9 #include <ostream> // NOLINT 9 #include <ostream> // NOLINT
10 10
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 const char* countryCode; 236 const char* countryCode;
237 const char* languageCode; 237 const char* languageCode;
238 const char* scriptCode; 238 const char* scriptCode;
239 bool expectedValid; 239 bool expectedValid;
240 }; 240 };
241 241
242 class PaymentsShippingAddressValidatorTest 242 class PaymentsShippingAddressValidatorTest
243 : public testing::TestWithParam<ShippingAddressTestCase> {}; 243 : public testing::TestWithParam<ShippingAddressTestCase> {};
244 244
245 TEST_P(PaymentsShippingAddressValidatorTest, IsValidShippingAddress) { 245 TEST_P(PaymentsShippingAddressValidatorTest, IsValidShippingAddress) {
246 mojom::blink::PaymentAddressPtr address = mojom::blink::PaymentAddress::New(); 246 payments::mojom::blink::PaymentAddressPtr address =
247 payments::mojom::blink::PaymentAddress::New();
247 address->country = GetParam().countryCode; 248 address->country = GetParam().countryCode;
248 address->language_code = GetParam().languageCode; 249 address->language_code = GetParam().languageCode;
249 address->script_code = GetParam().scriptCode; 250 address->script_code = GetParam().scriptCode;
250 251
251 String errorMessage; 252 String errorMessage;
252 EXPECT_EQ(GetParam().expectedValid, 253 EXPECT_EQ(GetParam().expectedValid,
253 PaymentsValidators::isValidShippingAddress(address, &errorMessage)) 254 PaymentsValidators::isValidShippingAddress(address, &errorMessage))
254 << errorMessage; 255 << errorMessage;
255 EXPECT_EQ(GetParam().expectedValid, errorMessage.isEmpty()) << errorMessage; 256 EXPECT_EQ(GetParam().expectedValid, errorMessage.isEmpty()) << errorMessage;
256 257
(...skipping 10 matching lines...) Expand all
267 ShippingAddressTestCase("US", "", "", true), 268 ShippingAddressTestCase("US", "", "", true),
268 // Invalid shipping addresses 269 // Invalid shipping addresses
269 ShippingAddressTestCase("", "", "", false), 270 ShippingAddressTestCase("", "", "", false),
270 ShippingAddressTestCase("InvalidCountryCode", "", "", false), 271 ShippingAddressTestCase("InvalidCountryCode", "", "", false),
271 ShippingAddressTestCase("US", "InvalidLanguageCode", "", false), 272 ShippingAddressTestCase("US", "InvalidLanguageCode", "", false),
272 ShippingAddressTestCase("US", "en", "InvalidScriptCode", false), 273 ShippingAddressTestCase("US", "en", "InvalidScriptCode", false),
273 ShippingAddressTestCase("US", "", "Latn", false))); 274 ShippingAddressTestCase("US", "", "Latn", false)));
274 275
275 } // namespace 276 } // namespace
276 } // namespace blink 277 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/payments/PaymentsValidators.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698