Reland: Add browser_test for extension app API with missing schema
[chromium-blink-merge.git] / content / test / frame_load_waiter.cc
blob6343f8523f010c4a5d8a5d787215167b50c8c46c
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"
10 namespace content {
12 FrameLoadWaiter::FrameLoadWaiter(RenderFrame* frame)
13 : RenderFrameObserver(frame) {
16 void FrameLoadWaiter::Wait() {
17 // Pump messages until Blink's threaded HTML parser finishes.
18 run_loop_.Run();
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