OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/string16.h" | 6 #include "base/string16.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "components/autofill/browser/phone_number_i18n.h" | 8 #include "components/autofill/browser/phone_number_i18n.h" |
9 #include "content/public/test/test_browser_thread.h" | 9 #include "content/public/test/test_browser_thread.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 330 |
331 TEST(PhoneNumberI18NTest, PhoneNumbersMatch) { | 331 TEST(PhoneNumberI18NTest, PhoneNumbersMatch) { |
332 // Same numbers, defined country code. | 332 // Same numbers, defined country code. |
333 EXPECT_TRUE(PhoneNumbersMatch(ASCIIToUTF16("4158889999"), | 333 EXPECT_TRUE(PhoneNumbersMatch(ASCIIToUTF16("4158889999"), |
334 ASCIIToUTF16("4158889999"), | 334 ASCIIToUTF16("4158889999"), |
335 "US", | 335 "US", |
336 "en-US")); | 336 "en-US")); |
337 // Same numbers, undefined country code. | 337 // Same numbers, undefined country code. |
338 EXPECT_TRUE(PhoneNumbersMatch(ASCIIToUTF16("4158889999"), | 338 EXPECT_TRUE(PhoneNumbersMatch(ASCIIToUTF16("4158889999"), |
339 ASCIIToUTF16("4158889999"), | 339 ASCIIToUTF16("4158889999"), |
340 "", | 340 std::string(), |
341 "en-US")); | 341 "en-US")); |
342 | 342 |
343 // Numbers differ by country code only. | 343 // Numbers differ by country code only. |
344 EXPECT_TRUE(PhoneNumbersMatch(ASCIIToUTF16("14158889999"), | 344 EXPECT_TRUE(PhoneNumbersMatch(ASCIIToUTF16("14158889999"), |
345 ASCIIToUTF16("4158889999"), | 345 ASCIIToUTF16("4158889999"), |
346 "US", | 346 "US", |
347 "en-US")); | 347 "en-US")); |
348 | 348 |
349 // Same numbers, different formats. | 349 // Same numbers, different formats. |
350 EXPECT_TRUE(PhoneNumbersMatch(ASCIIToUTF16("4158889999"), | 350 EXPECT_TRUE(PhoneNumbersMatch(ASCIIToUTF16("4158889999"), |
(...skipping 22 matching lines...) Expand all Loading... |
373 ASCIIToUTF16("8889999"), | 373 ASCIIToUTF16("8889999"), |
374 "US", | 374 "US", |
375 "en-US")); | 375 "en-US")); |
376 | 376 |
377 // Different numbers don't match. | 377 // Different numbers don't match. |
378 EXPECT_FALSE(PhoneNumbersMatch(ASCIIToUTF16("14158889999"), | 378 EXPECT_FALSE(PhoneNumbersMatch(ASCIIToUTF16("14158889999"), |
379 ASCIIToUTF16("1415888"), | 379 ASCIIToUTF16("1415888"), |
380 "US", | 380 "US", |
381 "en-US")); | 381 "en-US")); |
382 } | 382 } |
OLD | NEW |