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 "chrome/renderer/spellchecker/spellcheck_provider_test.h" | 5 #include "chrome/renderer/spellchecker/spellcheck_provider_test.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "chrome/common/spellcheck_marker.h" |
8 #include "chrome/common/spellcheck_messages.h" | 9 #include "chrome/common/spellcheck_messages.h" |
9 #include "chrome/renderer/spellchecker/spellcheck.h" | 10 #include "chrome/renderer/spellchecker/spellcheck.h" |
10 #include "ipc/ipc_message_macros.h" | 11 #include "ipc/ipc_message_macros.h" |
11 | 12 |
12 class MockSpellcheck: public SpellCheck { | 13 class MockSpellcheck: public SpellCheck { |
13 }; | 14 }; |
14 | 15 |
15 FakeTextCheckingCompletion::FakeTextCheckingCompletion() | 16 FakeTextCheckingCompletion::FakeTextCheckingCompletion() |
16 : completion_count_(0), | 17 : completion_count_(0), |
17 cancellation_count_(0) { | 18 cancellation_count_(0) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 delete message; | 54 delete message; |
54 return true; | 55 return true; |
55 } | 56 } |
56 | 57 |
57 messages_.push_back(message); | 58 messages_.push_back(message); |
58 return true; | 59 return true; |
59 } | 60 } |
60 | 61 |
61 void TestingSpellCheckProvider::OnCallSpellingService(int route_id, | 62 void TestingSpellCheckProvider::OnCallSpellingService(int route_id, |
62 int identifier, | 63 int identifier, |
63 const string16& text) { | 64 const string16& text, |
| 65 const std::vector<SpellCheckMarker>& markers) { |
64 #if defined (OS_MACOSX) | 66 #if defined (OS_MACOSX) |
65 NOTREACHED(); | 67 NOTREACHED(); |
66 #else | 68 #else |
67 ++spelling_service_call_count_; | 69 ++spelling_service_call_count_; |
68 WebKit::WebTextCheckingCompletion* completion = | 70 WebKit::WebTextCheckingCompletion* completion = |
69 text_check_completions_.Lookup(identifier); | 71 text_check_completions_.Lookup(identifier); |
70 if (!completion) { | 72 if (!completion) { |
71 ResetResult(); | 73 ResetResult(); |
72 return; | 74 return; |
73 } | 75 } |
(...skipping 10 matching lines...) Expand all Loading... |
84 } | 86 } |
85 | 87 |
86 void TestingSpellCheckProvider::ResetResult() { | 88 void TestingSpellCheckProvider::ResetResult() { |
87 text_.clear(); | 89 text_.clear(); |
88 } | 90 } |
89 | 91 |
90 SpellCheckProviderTest::SpellCheckProviderTest() {} | 92 SpellCheckProviderTest::SpellCheckProviderTest() {} |
91 SpellCheckProviderTest::~SpellCheckProviderTest() {} | 93 SpellCheckProviderTest::~SpellCheckProviderTest() {} |
92 | 94 |
93 | 95 |
OLD | NEW |