OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/public/browser/content_browser_client.h" |
| 7 #include "content/public/common/content_client.h" |
6 #include "content/public/common/content_switches.h" | 8 #include "content/public/common/content_switches.h" |
7 #include "content/public/renderer/content_renderer_client.h" | 9 #include "content/public/renderer/content_renderer_client.h" |
8 #include "content/renderer/render_process_impl.h" | 10 #include "content/renderer/render_process_impl.h" |
9 #include "content/renderer/render_thread_impl.h" | 11 #include "content/renderer/render_thread_impl.h" |
10 #include "content/test/mock_render_process.h" | 12 #include "content/test/mock_render_process.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
12 | 14 |
13 namespace content { | 15 namespace content { |
14 namespace { | 16 namespace { |
15 | 17 |
(...skipping 21 matching lines...) Expand all Loading... |
37 DISABLED_InputHandlerManagerDestroyedAfterCompositorThread | 39 DISABLED_InputHandlerManagerDestroyedAfterCompositorThread |
38 #else | 40 #else |
39 #define MAYBE_InputHandlerManagerDestroyedAfterCompositorThread \ | 41 #define MAYBE_InputHandlerManagerDestroyedAfterCompositorThread \ |
40 InputHandlerManagerDestroyedAfterCompositorThread | 42 InputHandlerManagerDestroyedAfterCompositorThread |
41 #endif | 43 #endif |
42 TEST_F(RenderThreadImplBrowserTest, | 44 TEST_F(RenderThreadImplBrowserTest, |
43 MAYBE_InputHandlerManagerDestroyedAfterCompositorThread) { | 45 MAYBE_InputHandlerManagerDestroyedAfterCompositorThread) { |
44 CommandLine::ForCurrentProcess()->AppendSwitch( | 46 CommandLine::ForCurrentProcess()->AppendSwitch( |
45 switches::kEnableThreadedCompositing); | 47 switches::kEnableThreadedCompositing); |
46 | 48 |
| 49 ContentClient content_client; |
| 50 ContentBrowserClient content_browser_client; |
47 ContentRendererClient content_renderer_client; | 51 ContentRendererClient content_renderer_client; |
| 52 SetContentClient(&content_client); |
| 53 SetBrowserClientForTesting(&content_browser_client); |
48 SetRendererClientForTesting(&content_renderer_client); | 54 SetRendererClientForTesting(&content_renderer_client); |
49 base::MessageLoopForIO message_loop_; | 55 base::MessageLoopForIO message_loop_; |
50 | 56 |
51 std::string channel_id = IPC::Channel::GenerateVerifiedChannelID( | 57 std::string channel_id = IPC::Channel::GenerateVerifiedChannelID( |
52 std::string()); | 58 std::string()); |
53 DummyListener dummy_listener; | 59 DummyListener dummy_listener; |
54 IPC::Channel channel(channel_id, IPC::Channel::MODE_SERVER, &dummy_listener); | 60 IPC::Channel channel(channel_id, IPC::Channel::MODE_SERVER, &dummy_listener); |
55 ASSERT_TRUE(channel.Connect()); | 61 ASSERT_TRUE(channel.Connect()); |
56 | 62 |
57 scoped_ptr<MockRenderProcess> mock_process(new MockRenderProcess); | 63 scoped_ptr<MockRenderProcess> mock_process(new MockRenderProcess); |
58 // Owned by mock_process. | 64 // Owned by mock_process. |
59 RenderThreadImpl* thread = new RenderThreadImpl(channel_id); | 65 RenderThreadImpl* thread = new RenderThreadImpl(channel_id); |
60 thread->EnsureWebKitInitialized(); | 66 thread->EnsureWebKitInitialized(); |
61 | 67 |
62 ASSERT_TRUE(thread->input_handler_manager()); | 68 ASSERT_TRUE(thread->input_handler_manager()); |
63 | 69 |
64 thread->compositor_message_loop_proxy()->PostTask( | 70 thread->compositor_message_loop_proxy()->PostTask( |
65 FROM_HERE, | 71 FROM_HERE, |
66 base::Bind(&CheckRenderThreadInputHandlerManager, thread)); | 72 base::Bind(&CheckRenderThreadInputHandlerManager, thread)); |
67 } | 73 } |
68 | 74 |
69 } // namespace | 75 } // namespace |
70 } // namespace content | 76 } // namespace content |
OLD | NEW |