| 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/renderer/spellchecker/spellcheck.h" | 8 #include "chrome/renderer/spellchecker/spellcheck.h" |
| 9 #include "components/spellcheck/common/spellcheck_marker.h" | |
| 10 #include "components/spellcheck/common/spellcheck_messages.h" | 9 #include "components/spellcheck/common/spellcheck_messages.h" |
| 11 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
| 12 | 11 |
| 13 class MockSpellcheck: public SpellCheck { | 12 class MockSpellcheck: public SpellCheck { |
| 14 }; | 13 }; |
| 15 | 14 |
| 16 FakeTextCheckingCompletion::FakeTextCheckingCompletion() | 15 FakeTextCheckingCompletion::FakeTextCheckingCompletion() |
| 17 : completion_count_(0), | 16 : completion_count_(0), |
| 18 cancellation_count_(0) { | 17 cancellation_count_(0) { |
| 19 } | 18 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 return true; | 59 return true; |
| 61 } | 60 } |
| 62 #endif | 61 #endif |
| 63 | 62 |
| 64 messages_.push_back(message); | 63 messages_.push_back(message); |
| 65 return true; | 64 return true; |
| 66 } | 65 } |
| 67 | 66 |
| 68 void TestingSpellCheckProvider::OnCallSpellingService(int route_id, | 67 void TestingSpellCheckProvider::OnCallSpellingService(int route_id, |
| 69 int identifier, | 68 int identifier, |
| 70 const base::string16& text, | 69 const base::string16& text) { |
| 71 const std::vector<SpellCheckMarker>& markers) { | |
| 72 #if defined (USE_BROWSER_SPELLCHECKER) | 70 #if defined (USE_BROWSER_SPELLCHECKER) |
| 73 NOTREACHED(); | 71 NOTREACHED(); |
| 74 #else | 72 #else |
| 75 ++spelling_service_call_count_; | 73 ++spelling_service_call_count_; |
| 76 blink::WebTextCheckingCompletion* completion = | 74 blink::WebTextCheckingCompletion* completion = |
| 77 text_check_completions_.Lookup(identifier); | 75 text_check_completions_.Lookup(identifier); |
| 78 if (!completion) { | 76 if (!completion) { |
| 79 ResetResult(); | 77 ResetResult(); |
| 80 return; | 78 return; |
| 81 } | 79 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 92 } | 90 } |
| 93 | 91 |
| 94 void TestingSpellCheckProvider::ResetResult() { | 92 void TestingSpellCheckProvider::ResetResult() { |
| 95 text_.clear(); | 93 text_.clear(); |
| 96 } | 94 } |
| 97 | 95 |
| 98 SpellCheckProviderTest::SpellCheckProviderTest() {} | 96 SpellCheckProviderTest::SpellCheckProviderTest() {} |
| 99 SpellCheckProviderTest::~SpellCheckProviderTest() {} | 97 SpellCheckProviderTest::~SpellCheckProviderTest() {} |
| 100 | 98 |
| 101 | 99 |
| OLD | NEW |