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
3 // found in the LICENSE file.
5 #include "content/test/frame_load_waiter.h"
7 #include "base/location.h"
8 #include "base/message_loop/message_loop.h"
12 FrameLoadWaiter::FrameLoadWaiter(RenderFrame
* frame
)
13 : RenderFrameObserver(frame
) {
16 void FrameLoadWaiter::Wait() {
17 // Pump messages until Blink's threaded HTML parser finishes.
21 void FrameLoadWaiter::DidFinishLoad() {
22 // Post a task to quit instead of quitting directly, since the load completion
23 // may trigger other IPCs that tests are expecting.
24 base::MessageLoop::current()->PostTask(FROM_HERE
, run_loop_
.QuitClosure());
27 } // namespace content