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

Side by Side Diff: content/renderer/render_thread_impl_browsertest.cc

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/common/content_switches.h" 6 #include "content/public/common/content_switches.h"
7 #include "content/public/renderer/content_renderer_client.h" 7 #include "content/public/renderer/content_renderer_client.h"
8 #include "content/renderer/render_process_impl.h" 8 #include "content/renderer/render_process_impl.h"
9 #include "content/renderer/render_thread_impl.h" 9 #include "content/renderer/render_thread_impl.h"
10 #include "content/test/mock_render_process.h" 10 #include "content/test/mock_render_process.h"
(...skipping 20 matching lines...) Expand all
31 31
32 // Check that InputHandlerManager outlives compositor thread because it uses 32 // Check that InputHandlerManager outlives compositor thread because it uses
33 // raw pointers to post tasks. 33 // raw pointers to post tasks.
34 TEST_F(RenderThreadImplBrowserTest, 34 TEST_F(RenderThreadImplBrowserTest,
35 InputHandlerManagerDestroyedAfterCompositorThread) { 35 InputHandlerManagerDestroyedAfterCompositorThread) {
36 CommandLine::ForCurrentProcess()->AppendSwitch( 36 CommandLine::ForCurrentProcess()->AppendSwitch(
37 switches::kEnableThreadedCompositing); 37 switches::kEnableThreadedCompositing);
38 38
39 ContentRendererClient content_renderer_client; 39 ContentRendererClient content_renderer_client;
40 SetRendererClientForTesting(&content_renderer_client); 40 SetRendererClientForTesting(&content_renderer_client);
41 MessageLoopForIO message_loop_; 41 base::MessageLoopForIO message_loop_;
42 42
43 std::string channel_id = IPC::Channel::GenerateVerifiedChannelID( 43 std::string channel_id = IPC::Channel::GenerateVerifiedChannelID(
44 std::string()); 44 std::string());
45 DummyListener dummy_listener; 45 DummyListener dummy_listener;
46 IPC::Channel channel(channel_id, IPC::Channel::MODE_SERVER, &dummy_listener); 46 IPC::Channel channel(channel_id, IPC::Channel::MODE_SERVER, &dummy_listener);
47 ASSERT_TRUE(channel.Connect()); 47 ASSERT_TRUE(channel.Connect());
48 48
49 scoped_ptr<MockRenderProcess> mock_process(new MockRenderProcess); 49 scoped_ptr<MockRenderProcess> mock_process(new MockRenderProcess);
50 // Owned by mock_process. 50 // Owned by mock_process.
51 RenderThreadImpl* thread = new RenderThreadImpl(channel_id); 51 RenderThreadImpl* thread = new RenderThreadImpl(channel_id);
52 thread->EnsureWebKitInitialized(); 52 thread->EnsureWebKitInitialized();
53 53
54 ASSERT_TRUE(thread->input_handler_manager()); 54 ASSERT_TRUE(thread->input_handler_manager());
55 55
56 thread->compositor_message_loop_proxy()->PostTask( 56 thread->compositor_message_loop_proxy()->PostTask(
57 FROM_HERE, 57 FROM_HERE,
58 base::Bind(&CheckRenderThreadInputHandlerManager, thread)); 58 base::Bind(&CheckRenderThreadInputHandlerManager, thread));
59 } 59 }
60 60
61 } // namespace 61 } // namespace
62 } // namespace content 62 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698