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/hyphenator/hyphenator.h" | 5 #include "content/renderer/hyphenator/hyphenator.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/platform_file.h" | 8 #include "base/platform_file.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "content/common/hyphenator_messages.h" | 10 #include "content/common/hyphenator_messages.h" |
11 #include "content/public/test/mock_render_thread.h" | 11 #include "content/public/test/mock_render_thread.h" |
12 #include "ipc/ipc_listener.h" | 12 #include "ipc/ipc_listener.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "third_party/hyphen/hyphen.h" | 14 #include "third_party/hyphen/hyphen.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 namespace { | 17 namespace { |
18 | 18 |
19 // A mock message listener that listens for HyphenatorHost messages. This class | 19 // A mock message listener that listens for HyphenatorHost messages. This class |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // Verify that we can now hyphenate words. When the MockListener class | 182 // Verify that we can now hyphenate words. When the MockListener class |
183 // receives a HyphenatorHostMsg_OpenDictionary message, it calls the | 183 // receives a HyphenatorHostMsg_OpenDictionary message, it calls the |
184 // OnControlMessageReceived function with a HyphenatorMsg_SetDictionary | 184 // OnControlMessageReceived function with a HyphenatorMsg_SetDictionary |
185 // message. So, the Hyphenate function should be able to hyphenate words now. | 185 // message. So, the Hyphenate function should be able to hyphenate words now. |
186 string16 input = ASCIIToUTF16("hyphenation"); | 186 string16 input = ASCIIToUTF16("hyphenation"); |
187 string16 expected = ASCIIToUTF16("hy-phen-ation"); | 187 string16 expected = ASCIIToUTF16("hy-phen-ation"); |
188 EXPECT_EQ(expected, Hyphenate(input)); | 188 EXPECT_EQ(expected, Hyphenate(input)); |
189 } | 189 } |
190 | 190 |
191 } // namespace content | 191 } // namespace content |
OLD | NEW |