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 #import "content/browser/renderer_host/text_input_client_mac.h" | 5 #import "content/browser/renderer_host/text_input_client_mac.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "content/browser/renderer_host/render_process_host_impl.h" | 10 #include "content/browser/renderer_host/render_process_host_impl.h" |
11 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 11 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
12 #include "content/browser/renderer_host/render_widget_host_impl.h" | 12 #include "content/browser/renderer_host/render_widget_host_impl.h" |
13 #include "content/browser/renderer_host/text_input_client_message_filter.h" | 13 #include "content/browser/renderer_host/text_input_client_message_filter.h" |
14 #include "content/common/text_input_client_messages.h" | 14 #include "content/common/text_input_client_messages.h" |
15 #include "content/public/test/mock_render_process_host.h" | 15 #include "content/public/test/mock_render_process_host.h" |
16 #include "content/public/test/test_browser_context.h" | 16 #include "content/public/test/test_browser_context.h" |
17 #include "ipc/ipc_test_sink.h" | 17 #include "ipc/ipc_test_sink.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "testing/gtest_mac.h" | 19 #include "testing/gtest_mac.h" |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 | 22 |
23 namespace { | 23 namespace { |
24 const int64 kTaskDelayMs = 200; | 24 const int64 kTaskDelayMs = 200; |
25 | 25 |
26 class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { | 26 class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { |
27 public: | 27 public: |
28 MockRenderWidgetHostDelegate() {} | 28 MockRenderWidgetHostDelegate() {} |
29 ~MockRenderWidgetHostDelegate() override {} | 29 ~MockRenderWidgetHostDelegate() override {} |
| 30 |
| 31 private: |
| 32 void Cut() override {} |
| 33 void Copy() override {} |
| 34 void Paste() override {} |
30 }; | 35 }; |
31 | 36 |
32 // This test does not test the WebKit side of the dictionary system (which | 37 // This test does not test the WebKit side of the dictionary system (which |
33 // performs the actual data fetching), but rather this just tests that the | 38 // performs the actual data fetching), but rather this just tests that the |
34 // service's signaling system works. | 39 // service's signaling system works. |
35 class TextInputClientMacTest : public testing::Test { | 40 class TextInputClientMacTest : public testing::Test { |
36 public: | 41 public: |
37 TextInputClientMacTest() | 42 TextInputClientMacTest() |
38 : browser_context_(), | 43 : browser_context_(), |
39 process_factory_(), | 44 process_factory_(), |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 TEST_F(TextInputClientMacTest, TimeoutSubstring) { | 227 TEST_F(TextInputClientMacTest, TimeoutSubstring) { |
223 NSAttributedString* string = service()->GetAttributedSubstringFromRange( | 228 NSAttributedString* string = service()->GetAttributedSubstringFromRange( |
224 widget(), NSMakeRange(0, 32)); | 229 widget(), NSMakeRange(0, 32)); |
225 EXPECT_EQ(nil, string); | 230 EXPECT_EQ(nil, string); |
226 EXPECT_EQ(1U, ipc_sink().message_count()); | 231 EXPECT_EQ(1U, ipc_sink().message_count()); |
227 EXPECT_TRUE(ipc_sink().GetUniqueMessageMatching( | 232 EXPECT_TRUE(ipc_sink().GetUniqueMessageMatching( |
228 TextInputClientMsg_StringForRange::ID)); | 233 TextInputClientMsg_StringForRange::ID)); |
229 } | 234 } |
230 | 235 |
231 } // namespace content | 236 } // namespace content |
OLD | NEW |