| 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 virtual ~MockRenderWidgetHostDelegate() {} | 29 ~MockRenderWidgetHostDelegate() override {} |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 // This test does not test the WebKit side of the dictionary system (which | 32 // 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 | 33 // performs the actual data fetching), but rather this just tests that the |
| 34 // service's signaling system works. | 34 // service's signaling system works. |
| 35 class TextInputClientMacTest : public testing::Test { | 35 class TextInputClientMacTest : public testing::Test { |
| 36 public: | 36 public: |
| 37 TextInputClientMacTest() | 37 TextInputClientMacTest() |
| 38 : browser_context_(), | 38 : browser_context_(), |
| 39 process_factory_(), | 39 process_factory_(), |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 TEST_F(TextInputClientMacTest, TimeoutSubstring) { | 221 TEST_F(TextInputClientMacTest, TimeoutSubstring) { |
| 222 NSAttributedString* string = service()->GetAttributedSubstringFromRange( | 222 NSAttributedString* string = service()->GetAttributedSubstringFromRange( |
| 223 widget(), NSMakeRange(0, 32)); | 223 widget(), NSMakeRange(0, 32)); |
| 224 EXPECT_EQ(nil, string); | 224 EXPECT_EQ(nil, string); |
| 225 EXPECT_EQ(1U, ipc_sink().message_count()); | 225 EXPECT_EQ(1U, ipc_sink().message_count()); |
| 226 EXPECT_TRUE(ipc_sink().GetUniqueMessageMatching( | 226 EXPECT_TRUE(ipc_sink().GetUniqueMessageMatching( |
| 227 TextInputClientMsg_StringForRange::ID)); | 227 TextInputClientMsg_StringForRange::ID)); |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace content | 230 } // namespace content |
| OLD | NEW |