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 "content/renderer/android/email_detector.h" | 5 #include "content/renderer/android/email_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 EmailDetectorTest : public testing::Test { | 14 class EmailDetectorTest : public testing::Test { |
13 public: | 15 public: |
14 static void FindAndCheckEmail(const std::string& content, | 16 static void FindAndCheckEmail(const std::string& content, |
15 const std::string& expected) { | 17 const std::string& expected) { |
16 base::string16 content_16 = base::UTF8ToUTF16(content); | 18 base::string16 content_16 = base::UTF8ToUTF16(content); |
(...skipping 27 matching lines...) Expand all Loading... |
44 FindAndCheckEmail("Apples @2.50 each", ""); | 46 FindAndCheckEmail("Apples @2.50 each", ""); |
45 FindAndCheckEmail("Log on to google.com", ""); | 47 FindAndCheckEmail("Log on to google.com", ""); |
46 FindAndCheckEmail("Try someone@, they might know.", ""); | 48 FindAndCheckEmail("Try someone@, they might know.", ""); |
47 FindAndCheckEmail("No, bob@com is not an email address.", ""); | 49 FindAndCheckEmail("No, bob@com is not an email address.", ""); |
48 FindAndCheckEmail("@", ""); | 50 FindAndCheckEmail("@", ""); |
49 FindAndCheckEmail("Just bob @google.com", ""); | 51 FindAndCheckEmail("Just bob @google.com", ""); |
50 FindAndCheckEmail("Why not call larry@google and ask him.", ""); | 52 FindAndCheckEmail("Why not call larry@google and ask him.", ""); |
51 } | 53 } |
52 | 54 |
53 } // namespace content | 55 } // namespace content |
OLD | NEW |