OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/public/test/frame_load_waiter.h" | 5 #include "content/public/test/frame_load_waiter.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 FrameLoadWaiter::FrameLoadWaiter(RenderFrame* frame) | 13 FrameLoadWaiter::FrameLoadWaiter(RenderFrame* frame) |
14 : RenderFrameObserver(frame) { | 14 : RenderFrameObserver(frame) { |
15 } | 15 } |
16 | 16 |
17 void FrameLoadWaiter::Wait() { | 17 void FrameLoadWaiter::Wait() { |
18 // Pump messages until Blink's threaded HTML parser finishes. | 18 // Pump messages until Blink's threaded HTML parser finishes. |
19 run_loop_.Run(); | 19 run_loop_.Run(); |
20 } | 20 } |
21 | 21 |
22 void FrameLoadWaiter::DidFinishLoad() { | 22 void FrameLoadWaiter::DidFinishLoad() { |
23 // Post a task to quit instead of quitting directly, since the load completion | 23 // Post a task to quit instead of quitting directly, since the load completion |
24 // may trigger other IPCs that tests are expecting. | 24 // may trigger other IPCs that tests are expecting. |
25 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, | 25 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
26 run_loop_.QuitClosure()); | 26 run_loop_.QuitClosure()); |
27 } | 27 } |
28 | 28 |
29 } // namespace content | 29 } // namespace content |
OLD | NEW |