Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: chrome/renderer/spellchecker/spellcheck_provider_test.cc

Issue 283623002: Add support for passing an arbitrary parameter to an IPC message handler. The motivation is for Web… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_marker.h"
9 #include "chrome/common/spellcheck_messages.h" 9 #include "chrome/common/spellcheck_messages.h"
10 #include "chrome/renderer/spellchecker/spellcheck.h" 10 #include "chrome/renderer/spellchecker/spellcheck.h"
(...skipping 22 matching lines...) Expand all
33 TestingSpellCheckProvider::TestingSpellCheckProvider() 33 TestingSpellCheckProvider::TestingSpellCheckProvider()
34 : SpellCheckProvider(NULL, new MockSpellcheck), 34 : SpellCheckProvider(NULL, new MockSpellcheck),
35 spelling_service_call_count_(0) { 35 spelling_service_call_count_(0) {
36 } 36 }
37 37
38 TestingSpellCheckProvider::~TestingSpellCheckProvider() { 38 TestingSpellCheckProvider::~TestingSpellCheckProvider() {
39 delete spellcheck_; 39 delete spellcheck_;
40 } 40 }
41 41
42 bool TestingSpellCheckProvider::Send(IPC::Message* message) { 42 bool TestingSpellCheckProvider::Send(IPC::Message* message) {
43 #if !defined(OS_MACOSX)
43 // Call our mock message handlers. 44 // Call our mock message handlers.
44 bool handled = true; 45 bool handled = true;
45 IPC_BEGIN_MESSAGE_MAP(TestingSpellCheckProvider, *message) 46 IPC_BEGIN_MESSAGE_MAP(TestingSpellCheckProvider, *message)
46 #if !defined(OS_MACOSX)
47 IPC_MESSAGE_HANDLER(SpellCheckHostMsg_CallSpellingService, 47 IPC_MESSAGE_HANDLER(SpellCheckHostMsg_CallSpellingService,
48 OnCallSpellingService) 48 OnCallSpellingService)
49 #endif
50 IPC_MESSAGE_UNHANDLED(handled = false) 49 IPC_MESSAGE_UNHANDLED(handled = false)
51 IPC_END_MESSAGE_MAP() 50 IPC_END_MESSAGE_MAP()
52 51
53 if (handled) { 52 if (handled) {
54 delete message; 53 delete message;
55 return true; 54 return true;
56 } 55 }
56 #endif
57 57
58 messages_.push_back(message); 58 messages_.push_back(message);
59 return true; 59 return true;
60 } 60 }
61 61
62 void TestingSpellCheckProvider::OnCallSpellingService(int route_id, 62 void TestingSpellCheckProvider::OnCallSpellingService(int route_id,
63 int identifier, 63 int identifier,
64 const base::string16& text, 64 const base::string16& text,
65 const std::vector<SpellCheckMarker>& markers) { 65 const std::vector<SpellCheckMarker>& markers) {
66 #if defined (OS_MACOSX) 66 #if defined (OS_MACOSX)
(...skipping 19 matching lines...) Expand all
86 } 86 }
87 87
88 void TestingSpellCheckProvider::ResetResult() { 88 void TestingSpellCheckProvider::ResetResult() {
89 text_.clear(); 89 text_.clear();
90 } 90 }
91 91
92 SpellCheckProviderTest::SpellCheckProviderTest() {} 92 SpellCheckProviderTest::SpellCheckProviderTest() {}
93 SpellCheckProviderTest::~SpellCheckProviderTest() {} 93 SpellCheckProviderTest::~SpellCheckProviderTest() {}
94 94
95 95
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698