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

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

Issue 9368052: Removed WebTextCheckingResult legacy API use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another trial... Created 8 years, 10 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "chrome/common/spellcheck_messages.h" 9 #include "chrome/common/spellcheck_messages.h"
10 #include "chrome/common/spellcheck_result.h"
10 #include "chrome/renderer/spellchecker/spellcheck_provider.h" 11 #include "chrome/renderer/spellchecker/spellcheck_provider.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" 13 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCheckingComple tion.h" 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCheckingComple tion.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCheckingResult .h" 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCheckingResult .h"
15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" 16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
16 17
17 namespace { 18 namespace {
18 19
19 // Faked test target, which stores sent message for verification, 20 // Faked test target, which stores sent message for verification,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 &parameters.router_id, 83 &parameters.router_id,
83 &parameters.request_id, 84 &parameters.request_id,
84 &parameters.document_tag, 85 &parameters.document_tag,
85 &parameters.text); 86 &parameters.text);
86 EXPECT_TRUE(ok); 87 EXPECT_TRUE(ok);
87 return parameters; 88 return parameters;
88 } 89 }
89 90
90 void FakeMessageArrival(SpellCheckProvider* provider, 91 void FakeMessageArrival(SpellCheckProvider* provider,
91 const MessageParameters& parameters) { 92 const MessageParameters& parameters) {
92 std::vector<WebKit::WebTextCheckingResult> fake_result; 93 std::vector<SpellCheckResult> fake_result;
93 bool handled = provider->OnMessageReceived( 94 bool handled = provider->OnMessageReceived(
94 SpellCheckMsg_RespondTextCheck( 95 SpellCheckMsg_RespondTextCheck(
95 0, 96 0,
96 parameters.request_id, 97 parameters.request_id,
97 parameters.document_tag, 98 parameters.document_tag,
98 fake_result)); 99 fake_result));
99 EXPECT_TRUE(handled); 100 EXPECT_TRUE(handled);
100 } 101 }
101 102
102 TEST_F(SpellCheckProviderMacTest, SingleRoundtripSuccess) { 103 TEST_F(SpellCheckProviderMacTest, SingleRoundtripSuccess) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 EXPECT_EQ(completion2.completion_count_, 0U); 150 EXPECT_EQ(completion2.completion_count_, 0U);
150 EXPECT_EQ(provider_.pending_text_request_size(), 1U); 151 EXPECT_EQ(provider_.pending_text_request_size(), 1U);
151 152
152 FakeMessageArrival(&provider_, read_parameters2); 153 FakeMessageArrival(&provider_, read_parameters2);
153 EXPECT_EQ(completion1.completion_count_, 1U); 154 EXPECT_EQ(completion1.completion_count_, 1U);
154 EXPECT_EQ(completion2.completion_count_, 1U); 155 EXPECT_EQ(completion2.completion_count_, 1U);
155 EXPECT_EQ(provider_.pending_text_request_size(), 0U); 156 EXPECT_EQ(provider_.pending_text_request_size(), 0U);
156 } 157 }
157 158
158 } // namespace 159 } // namespace
OLDNEW
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck_provider.cc ('k') | chrome/renderer/spellchecker/spellcheck_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698