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 "content/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/memory/discardable_memory.h" | 14 #include "base/memory/discardable_memory.h" |
| 15 #include "base/run_loop.h" |
15 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
16 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
17 #include "base/threading/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
18 #include "components/scheduler/renderer/renderer_scheduler.h" | 19 #include "components/scheduler/renderer/renderer_scheduler.h" |
19 #include "content/app/mojo/mojo_init.h" | 20 #include "content/app/mojo/mojo_init.h" |
20 #include "content/common/in_process_child_thread_params.h" | 21 #include "content/common/in_process_child_thread_params.h" |
21 #include "content/common/resource_messages.h" | 22 #include "content/common/resource_messages.h" |
22 #include "content/common/websocket_messages.h" | 23 #include "content/common/websocket_messages.h" |
23 #include "content/public/browser/content_browser_client.h" | 24 #include "content/public/browser/content_browser_client.h" |
24 #include "content/public/common/content_client.h" | 25 #include "content/public/common/content_client.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 thread_->compositor_task_runner()->PostTask( | 219 thread_->compositor_task_runner()->PostTask( |
219 FROM_HERE, base::Bind(&CheckRenderThreadInputHandlerManager, thread_)); | 220 FROM_HERE, base::Bind(&CheckRenderThreadInputHandlerManager, thread_)); |
220 } | 221 } |
221 | 222 |
222 // Disabled under LeakSanitizer due to memory leaks. | 223 // Disabled under LeakSanitizer due to memory leaks. |
223 TEST_F(RenderThreadImplBrowserTest, | 224 TEST_F(RenderThreadImplBrowserTest, |
224 WILL_LEAK(ResourceDispatchIPCTasksGoThroughScheduler)) { | 225 WILL_LEAK(ResourceDispatchIPCTasksGoThroughScheduler)) { |
225 test_helper_->Sender()->Send(new ResourceHostMsg_FollowRedirect(0)); | 226 test_helper_->Sender()->Send(new ResourceHostMsg_FollowRedirect(0)); |
226 test_helper_->Sender()->Send(new TestMsg_QuitRunLoop()); | 227 test_helper_->Sender()->Send(new TestMsg_QuitRunLoop()); |
227 | 228 |
228 test_helper_->GetMessageLoop()->Run(); | 229 base::RunLoop().Run(); |
229 EXPECT_EQ(1, test_task_counter_->NumTasksPosted()); | 230 EXPECT_EQ(1, test_task_counter_->NumTasksPosted()); |
230 } | 231 } |
231 | 232 |
232 // Disabled under LeakSanitizer due to memory leaks. | 233 // Disabled under LeakSanitizer due to memory leaks. |
233 TEST_F(RenderThreadImplBrowserTest, | 234 TEST_F(RenderThreadImplBrowserTest, |
234 WILL_LEAK(NonResourceDispatchIPCTasksDontGoThroughScheduler)) { | 235 WILL_LEAK(NonResourceDispatchIPCTasksDontGoThroughScheduler)) { |
235 // NOTE other than not being a resource message, the actual message is | 236 // NOTE other than not being a resource message, the actual message is |
236 // unimportant. | 237 // unimportant. |
237 test_helper_->Sender()->Send(new WebSocketMsg_NotifyFailure(1, "")); | 238 test_helper_->Sender()->Send(new WebSocketMsg_NotifyFailure(1, "")); |
238 test_helper_->Sender()->Send(new TestMsg_QuitRunLoop()); | 239 test_helper_->Sender()->Send(new TestMsg_QuitRunLoop()); |
239 | 240 |
240 test_helper_->GetMessageLoop()->Run(); | 241 base::RunLoop().Run(); |
241 | 242 |
242 EXPECT_EQ(0, test_task_counter_->NumTasksPosted()); | 243 EXPECT_EQ(0, test_task_counter_->NumTasksPosted()); |
243 } | 244 } |
244 | 245 |
245 } // namespace | 246 } // namespace |
246 } // namespace content | 247 } // namespace content |
OLD | NEW |