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

Side by Side Diff: content/renderer/android/phone_number_detector_unittest.cc

Issue 1547073003: Switch to standard integer types in content/renderer/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
OLDNEW
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 "content/renderer/android/phone_number_detector.h" 5 #include "content/renderer/android/phone_number_detector.h"
6 6
7 #include <stddef.h>
8
7 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
8 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
9 11
10 namespace content { 12 namespace content {
11 13
12 class PhoneNumberDetectorTest : public testing::Test { 14 class PhoneNumberDetectorTest : public testing::Test {
13 public: 15 public:
14 static std::string FindNumber(const std::string& content, 16 static std::string FindNumber(const std::string& content,
15 const std::string& region) { 17 const std::string& region) {
16 base::string16 content_16 = base::UTF8ToUTF16(content); 18 base::string16 content_16 = base::UTF8ToUTF16(content);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 EXPECT_EQ("+18002378289", FindAndFormatNumber("1-800-BEST BUY", "us")); 82 EXPECT_EQ("+18002378289", FindAndFormatNumber("1-800-BEST BUY", "us"));
81 // TODO(qinmin): support alpha number detection when there are characters on 83 // TODO(qinmin): support alpha number detection when there are characters on
82 // either side of the string. 84 // either side of the string.
83 EXPECT_EQ("", FindAndFormatNumber("hello 1-800-BEST-BUY", "us")); 85 EXPECT_EQ("", FindAndFormatNumber("hello 1-800-BEST-BUY", "us"));
84 EXPECT_EQ("", FindAndFormatNumber("BestBuy", "us")); 86 EXPECT_EQ("", FindAndFormatNumber("BestBuy", "us"));
85 EXPECT_EQ("", FindAndFormatNumber("1-BestBuy", "us")); 87 EXPECT_EQ("", FindAndFormatNumber("1-BestBuy", "us"));
86 EXPECT_EQ("", FindAndFormatNumber("1 BestBuy", "us")); 88 EXPECT_EQ("", FindAndFormatNumber("1 BestBuy", "us"));
87 } 89 }
88 90
89 } // namespace content 91 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/android/phone_number_detector.h ('k') | content/renderer/android/renderer_date_time_picker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698