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

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

Issue 2489943003: Revert of [Web Payments] Mojom namespace blink -> payments (Closed)
Patch Set: 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 payments::mojom::blink::PaymentAddressPtr address = 246 mojom::blink::PaymentAddressPtr address = mojom::blink::PaymentAddress::New();
247 payments::mojom::blink::PaymentAddress::New();
248 address->country = GetParam().countryCode; 247 address->country = GetParam().countryCode;
249 address->language_code = GetParam().languageCode; 248 address->language_code = GetParam().languageCode;
250 address->script_code = GetParam().scriptCode; 249 address->script_code = GetParam().scriptCode;
251 250
252 String errorMessage; 251 String errorMessage;
253 EXPECT_EQ(GetParam().expectedValid, 252 EXPECT_EQ(GetParam().expectedValid,
254 PaymentsValidators::isValidShippingAddress(address, &errorMessage)) 253 PaymentsValidators::isValidShippingAddress(address, &errorMessage))
255 << errorMessage; 254 << errorMessage;
256 EXPECT_EQ(GetParam().expectedValid, errorMessage.isEmpty()) << errorMessage; 255 EXPECT_EQ(GetParam().expectedValid, errorMessage.isEmpty()) << errorMessage;
257 256
(...skipping 10 matching lines...) Expand all
268 ShippingAddressTestCase("US", "", "", true), 267 ShippingAddressTestCase("US", "", "", true),
269 // Invalid shipping addresses 268 // Invalid shipping addresses
270 ShippingAddressTestCase("", "", "", false), 269 ShippingAddressTestCase("", "", "", false),
271 ShippingAddressTestCase("InvalidCountryCode", "", "", false), 270 ShippingAddressTestCase("InvalidCountryCode", "", "", false),
272 ShippingAddressTestCase("US", "InvalidLanguageCode", "", false), 271 ShippingAddressTestCase("US", "InvalidLanguageCode", "", false),
273 ShippingAddressTestCase("US", "en", "InvalidScriptCode", false), 272 ShippingAddressTestCase("US", "en", "InvalidScriptCode", false),
274 ShippingAddressTestCase("US", "", "Latn", false))); 273 ShippingAddressTestCase("US", "", "Latn", false)));
275 274
276 } // namespace 275 } // namespace
277 } // namespace blink 276 } // 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