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

Side by Side Diff: third_party/libaddressinput/chromium/chrome_address_validator_unittest.cc

Issue 403233002: Do not use \u unicode characters directly in libaddressinput unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | « no previous file | third_party/libaddressinput/chromium/string_compare_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "third_party/libaddressinput/chromium/chrome_address_validator.h" 5 #include "third_party/libaddressinput/chromium/chrome_address_validator.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/run_loop.h" 12 #include "base/run_loop.h"
13 #include "base/strings/utf_string_conversions.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_da ta.h" 15 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_da ta.h"
15 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_pr oblem.h" 16 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_pr oblem.h"
16 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_ui .h" 17 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_ui .h"
17 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/downloader .h" 18 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/downloader .h"
18 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/null_stora ge.h" 19 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/null_stora ge.h"
19 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/storage.h" 20 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/storage.h"
20 #include "third_party/libaddressinput/src/cpp/test/fake_downloader.h" 21 #include "third_party/libaddressinput/src/cpp/test/fake_downloader.h"
21 22
22 namespace autofill { 23 namespace autofill {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 EXPECT_TRUE(problems.empty()); 241 EXPECT_TRUE(problems.empty());
241 242
242 // Ignore capitalization. 243 // Ignore capitalization.
243 address.administrative_area = "teXas"; 244 address.administrative_area = "teXas";
244 problems.clear(); 245 problems.clear();
245 EXPECT_EQ(AddressValidator::SUCCESS, 246 EXPECT_EQ(AddressValidator::SUCCESS,
246 validator_->ValidateAddress(address, NULL, &problems)); 247 validator_->ValidateAddress(address, NULL, &problems));
247 EXPECT_TRUE(problems.empty()); 248 EXPECT_TRUE(problems.empty());
248 249
249 // Ignore diacriticals. 250 // Ignore diacriticals.
250 address.administrative_area = "T\u00E9xas"; 251 address.administrative_area = base::WideToUTF8(L"T\u00E9xas");
251 problems.clear(); 252 problems.clear();
252 EXPECT_EQ(AddressValidator::SUCCESS, 253 EXPECT_EQ(AddressValidator::SUCCESS,
253 validator_->ValidateAddress(address, NULL, &problems)); 254 validator_->ValidateAddress(address, NULL, &problems));
254 EXPECT_TRUE(problems.empty()); 255 EXPECT_TRUE(problems.empty());
255 } 256 }
256 257
257 TEST_F(AddressValidatorTest, BasicValidationFailure) { 258 TEST_F(AddressValidatorTest, BasicValidationFailure) {
258 // US rules should always be available, even though this load call fails. 259 // US rules should always be available, even though this load call fails.
259 validator_->LoadRules("US"); 260 validator_->LoadRules("US");
260 AddressData address; 261 AddressData address;
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 downloader_->set_failures_number(99); 886 downloader_->set_failures_number(99);
886 validator_->LoadRules("CH"); 887 validator_->LoadRules("CH");
887 validator_->LoadRules("GB"); 888 validator_->LoadRules("GB");
888 base::RunLoop().RunUntilIdle(); 889 base::RunLoop().RunUntilIdle();
889 890
890 EXPECT_FALSE(load_rules_success_); 891 EXPECT_FALSE(load_rules_success_);
891 EXPECT_EQ(16, downloader_->attempts_number()); 892 EXPECT_EQ(16, downloader_->attempts_number());
892 } 893 }
893 894
894 } // namespace autofill 895 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | third_party/libaddressinput/chromium/string_compare_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698