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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/common/spellcheck_marker.h" | 9 #include "chrome/common/spellcheck_marker.h" |
10 #include "chrome/common/spellcheck_messages.h" | 10 #include "chrome/common/spellcheck_messages.h" |
11 #include "chrome/renderer/spellchecker/spellcheck_provider_test.h" | 11 #include "chrome/renderer/spellchecker/spellcheck_provider_test.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "third_party/WebKit/public/platform/WebString.h" | 13 #include "third_party/WebKit/public/platform/WebString.h" |
14 | 14 |
15 // Tests for Hunspell functionality in SpellcheckingProvider | 15 // Tests for Hunspell functionality in SpellcheckingProvider |
16 | 16 |
17 using base::ASCIIToUTF16; | 17 using base::ASCIIToUTF16; |
| 18 using base::WideToUTF16; |
18 | 19 |
19 namespace { | 20 namespace { |
20 | 21 |
21 TEST_F(SpellCheckProviderTest, UsingHunspell) { | 22 TEST_F(SpellCheckProviderTest, UsingHunspell) { |
22 FakeTextCheckingCompletion completion; | 23 FakeTextCheckingCompletion completion; |
23 provider_.RequestTextChecking(blink::WebString("hello"), | 24 provider_.RequestTextChecking(blink::WebString("hello"), |
24 &completion, | 25 &completion, |
25 std::vector<SpellCheckMarker>()); | 26 std::vector<SpellCheckMarker>()); |
26 EXPECT_EQ(completion.completion_count_, 1U); | 27 EXPECT_EQ(completion.completion_count_, 1U); |
27 EXPECT_EQ(provider_.messages_.size(), 0U); | 28 EXPECT_EQ(provider_.messages_.size(), 0U); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 175 |
175 provider_.RequestTextChecking(blink::WebString("hello world."), | 176 provider_.RequestTextChecking(blink::WebString("hello world."), |
176 &completion, | 177 &completion, |
177 std::vector<SpellCheckMarker>()); | 178 std::vector<SpellCheckMarker>()); |
178 EXPECT_EQ(completion.completion_count_, 3U); | 179 EXPECT_EQ(completion.completion_count_, 3U); |
179 EXPECT_EQ(completion.cancellation_count_, 1U); | 180 EXPECT_EQ(completion.cancellation_count_, 1U); |
180 EXPECT_EQ(provider_.spelling_service_call_count_, 2U); | 181 EXPECT_EQ(provider_.spelling_service_call_count_, 2U); |
181 } | 182 } |
182 | 183 |
183 } // namespace | 184 } // namespace |
OLD | NEW |