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

Side by Side Diff: chrome/browser/autofill/phone_number_i18n_unittest.cc

Issue 10412031: Roll libphonenumber r456 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 8 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/autofill/phone_number_i18n.h" 8 #include "chrome/browser/autofill/phone_number_i18n.h"
9 #include "content/test/test_browser_thread.h" 9 #include "content/test/test_browser_thread.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 "US", 280 "US",
281 autofill_i18n::NATIONAL, 281 autofill_i18n::NATIONAL,
282 &number)); 282 &number));
283 EXPECT_EQ(number, ASCIIToUTF16("(650) 234-5678")); 283 EXPECT_EQ(number, ASCIIToUTF16("(650) 234-5678"));
284 EXPECT_TRUE(ConstructPhoneNumber(ASCIIToUTF16("1"), 284 EXPECT_TRUE(ConstructPhoneNumber(ASCIIToUTF16("1"),
285 ASCIIToUTF16("650"), 285 ASCIIToUTF16("650"),
286 ASCIIToUTF16("2345678"), 286 ASCIIToUTF16("2345678"),
287 "US", 287 "US",
288 autofill_i18n::RFC3966, 288 autofill_i18n::RFC3966,
289 &number)); 289 &number));
290 EXPECT_EQ(number, ASCIIToUTF16("+1-650-234-5678")); 290 EXPECT_EQ(number, ASCIIToUTF16("tel:+1-650-234-5678"));
291 EXPECT_TRUE(ConstructPhoneNumber(string16(), 291 EXPECT_TRUE(ConstructPhoneNumber(string16(),
292 ASCIIToUTF16("650"), 292 ASCIIToUTF16("650"),
293 ASCIIToUTF16("2345678"), 293 ASCIIToUTF16("2345678"),
294 "US", 294 "US",
295 autofill_i18n::INTERNATIONAL, 295 autofill_i18n::INTERNATIONAL,
296 &number)); 296 &number));
297 EXPECT_EQ(number, ASCIIToUTF16("+1 650-234-5678")); 297 EXPECT_EQ(number, ASCIIToUTF16("+1 650-234-5678"));
298 EXPECT_TRUE(ConstructPhoneNumber(string16(), 298 EXPECT_TRUE(ConstructPhoneNumber(string16(),
299 string16(), 299 string16(),
300 ASCIIToUTF16("6502345678"), 300 ASCIIToUTF16("6502345678"),
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 // Partial matches don't count. 371 // Partial matches don't count.
372 EXPECT_FALSE(PhoneNumbersMatch(ASCIIToUTF16("14158889999"), 372 EXPECT_FALSE(PhoneNumbersMatch(ASCIIToUTF16("14158889999"),
373 ASCIIToUTF16("8889999"), 373 ASCIIToUTF16("8889999"),
374 "US")); 374 "US"));
375 375
376 // Different numbers don't match. 376 // Different numbers don't match.
377 EXPECT_FALSE(PhoneNumbersMatch(ASCIIToUTF16("14158889999"), 377 EXPECT_FALSE(PhoneNumbersMatch(ASCIIToUTF16("14158889999"),
378 ASCIIToUTF16("1415888"), 378 ASCIIToUTF16("1415888"),
379 "US")); 379 "US"));
380 } 380 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698