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 "components/spellcheck/renderer/spellcheck_provider_test.h" | 5 #include "components/spellcheck/renderer/spellcheck_provider_test.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | |
7 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
8 #include "components/spellcheck/common/spellcheck_marker.h" | 9 #include "components/spellcheck/common/spellcheck_marker.h" |
9 #include "components/spellcheck/common/spellcheck_messages.h" | 10 #include "components/spellcheck/common/spellcheck_messages.h" |
10 #include "components/spellcheck/renderer/spellcheck.h" | 11 #include "components/spellcheck/renderer/spellcheck.h" |
11 #include "components/spellcheck/spellcheck_build_features.h" | 12 #include "components/spellcheck/spellcheck_build_features.h" |
12 #include "ipc/ipc_message_macros.h" | 13 #include "ipc/ipc_message_macros.h" |
13 | 14 |
14 class MockSpellcheck: public SpellCheck { | 15 class MockSpellcheck: public SpellCheck { |
15 }; | 16 }; |
16 | 17 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
55 OnCallSpellingService) | 56 OnCallSpellingService) |
56 IPC_MESSAGE_UNHANDLED(handled = false) | 57 IPC_MESSAGE_UNHANDLED(handled = false) |
57 IPC_END_MESSAGE_MAP() | 58 IPC_END_MESSAGE_MAP() |
58 | 59 |
59 if (handled) { | 60 if (handled) { |
60 delete message; | 61 delete message; |
61 return true; | 62 return true; |
62 } | 63 } |
63 #endif | 64 #endif |
64 | 65 |
65 messages_.push_back(message); | 66 messages_.push_back(base::WrapUnique<IPC::Message>(message)); |
groby-ooo-7-16
2017/01/26 17:40:47
This makes me queasy, because the use of unique_pt
ke.he
2017/01/27 03:15:40
In this testing class, the Send() function doesn't
groby-ooo-7-16
2017/02/02 16:05:44
AIUI, the Send() function always takes ownership -
ke.he
2017/02/03 00:58:57
Thanks:)
My understanding is: "the send() function
| |
66 return true; | 67 return true; |
67 } | 68 } |
68 | 69 |
69 void TestingSpellCheckProvider::OnCallSpellingService(int route_id, | 70 void TestingSpellCheckProvider::OnCallSpellingService(int route_id, |
70 int identifier, | 71 int identifier, |
71 const base::string16& text, | 72 const base::string16& text, |
72 const std::vector<SpellCheckMarker>& markers) { | 73 const std::vector<SpellCheckMarker>& markers) { |
73 #if BUILDFLAG(USE_BROWSER_SPELLCHECKER) | 74 #if BUILDFLAG(USE_BROWSER_SPELLCHECKER) |
74 NOTREACHED(); | 75 NOTREACHED(); |
75 #else | 76 #else |
(...skipping 29 matching lines...) Expand all Loading... | |
105 | 106 |
106 bool TestingSpellCheckProvider::SatisfyRequestFromCache( | 107 bool TestingSpellCheckProvider::SatisfyRequestFromCache( |
107 const base::string16& text, | 108 const base::string16& text, |
108 blink::WebTextCheckingCompletion* completion) { | 109 blink::WebTextCheckingCompletion* completion) { |
109 return SpellCheckProvider::SatisfyRequestFromCache(text, completion); | 110 return SpellCheckProvider::SatisfyRequestFromCache(text, completion); |
110 } | 111 } |
111 | 112 |
112 SpellCheckProviderTest::SpellCheckProviderTest() {} | 113 SpellCheckProviderTest::SpellCheckProviderTest() {} |
113 SpellCheckProviderTest::~SpellCheckProviderTest() {} | 114 SpellCheckProviderTest::~SpellCheckProviderTest() {} |
114 | 115 |
OLD | NEW |