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/browser/spellchecker/spellcheck_message_filter_platform.h" | 5 #include "chrome/browser/spellchecker/spellcheck_message_filter_platform.h" |
6 | 6 |
| 7 #include <tuple> |
| 8 |
7 #include "base/command_line.h" | 9 #include "base/command_line.h" |
8 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
9 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
10 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
11 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
12 #include "chrome/common/spellcheck_messages.h" | 14 #include "chrome/common/spellcheck_messages.h" |
13 #include "chrome/common/spellcheck_result.h" | 15 #include "chrome/common/spellcheck_result.h" |
14 #include "chrome/test/base/in_process_browser_test.h" | 16 #include "chrome/test/base/in_process_browser_test.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
16 | 18 |
(...skipping 29 matching lines...) Expand all Loading... |
46 SpellCheckHostMsg_RequestTextCheck to_be_received( | 48 SpellCheckHostMsg_RequestTextCheck to_be_received( |
47 123, 456, base::UTF8ToUTF16("zz."), std::vector<SpellCheckMarker>()); | 49 123, 456, base::UTF8ToUTF16("zz."), std::vector<SpellCheckMarker>()); |
48 target->OnMessageReceived(to_be_received); | 50 target->OnMessageReceived(to_be_received); |
49 | 51 |
50 base::MessageLoopForUI::current()->Run(); | 52 base::MessageLoopForUI::current()->Run(); |
51 EXPECT_EQ(1U, target->sent_messages_.size()); | 53 EXPECT_EQ(1U, target->sent_messages_.size()); |
52 | 54 |
53 SpellCheckMsg_RespondTextCheck::Param params; | 55 SpellCheckMsg_RespondTextCheck::Param params; |
54 bool ok = SpellCheckMsg_RespondTextCheck::Read( | 56 bool ok = SpellCheckMsg_RespondTextCheck::Read( |
55 target->sent_messages_[0], ¶ms); | 57 target->sent_messages_[0], ¶ms); |
56 std::vector<SpellCheckResult> sent_results = base::get<2>(params); | 58 std::vector<SpellCheckResult> sent_results = std::get<2>(params); |
57 | 59 |
58 EXPECT_TRUE(ok); | 60 EXPECT_TRUE(ok); |
59 EXPECT_EQ(1U, sent_results.size()); | 61 EXPECT_EQ(1U, sent_results.size()); |
60 EXPECT_EQ(sent_results[0].location, 0); | 62 EXPECT_EQ(sent_results[0].location, 0); |
61 EXPECT_EQ(sent_results[0].length, 2); | 63 EXPECT_EQ(sent_results[0].length, 2); |
62 EXPECT_EQ(sent_results[0].decoration, | 64 EXPECT_EQ(sent_results[0].decoration, |
63 SpellCheckResult::SPELLING); | 65 SpellCheckResult::SPELLING); |
64 } | 66 } |
OLD | NEW |