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

Side by Side Diff: chrome/browser/spellchecker/spellcheck_message_filter_mac_browsertest.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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/scoped_vector.h" 6 #include "base/memory/scoped_vector.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h" 10 #include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 SpellCheckHostMsg_RequestTextCheck to_be_received( 46 SpellCheckHostMsg_RequestTextCheck to_be_received(
47 123, 456, base::UTF8ToUTF16("zz."), std::vector<SpellCheckMarker>()); 47 123, 456, base::UTF8ToUTF16("zz."), std::vector<SpellCheckMarker>());
48 bool handled = false; 48 bool handled = false;
49 target->OnMessageReceived(to_be_received, &handled); 49 target->OnMessageReceived(to_be_received, &handled);
50 EXPECT_TRUE(handled); 50 EXPECT_TRUE(handled);
51 51
52 base::MessageLoopForUI::current()->Run(); 52 base::MessageLoopForUI::current()->Run();
53 EXPECT_EQ(1U, target->sent_messages_.size()); 53 EXPECT_EQ(1U, target->sent_messages_.size());
54 54
55 int sent_identifier; 55 SpellCheckMsg_RespondTextCheck::Param params;
56 std::vector<SpellCheckResult> sent_results;
57 bool ok = SpellCheckMsg_RespondTextCheck::Read( 56 bool ok = SpellCheckMsg_RespondTextCheck::Read(
58 target->sent_messages_[0], &sent_identifier, &sent_results); 57 target->sent_messages_[0], &params);
58 std::vector<SpellCheckResult> sent_results = params.b;
59
59 EXPECT_TRUE(ok); 60 EXPECT_TRUE(ok);
60 EXPECT_EQ(1U, sent_results.size()); 61 EXPECT_EQ(1U, sent_results.size());
61 EXPECT_EQ(sent_results[0].location, 0); 62 EXPECT_EQ(sent_results[0].location, 0);
62 EXPECT_EQ(sent_results[0].length, 2); 63 EXPECT_EQ(sent_results[0].length, 2);
63 EXPECT_EQ(sent_results[0].decoration, 64 EXPECT_EQ(sent_results[0].decoration,
64 SpellCheckResult::SPELLING); 65 SpellCheckResult::SPELLING);
65 } 66 }
OLDNEW
« no previous file with comments | « chrome/browser/search/instant_service_unittest.cc ('k') | chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698