OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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. | |
4 | |
5 #include "content/browser/browser_plugin/test_browser_plugin_embedder.h" | |
6 | |
7 #include "base/time.h" | |
8 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | |
9 #include "content/browser/browser_plugin/browser_plugin_guest.h" | |
10 #include "content/browser/renderer_host/render_view_host_impl.h" | |
11 #include "content/browser/web_contents/web_contents_impl.h" | |
12 #include "content/public/test/test_utils.h" | |
13 | |
14 namespace content { | |
15 | |
16 TestBrowserPluginEmbedder::TestBrowserPluginEmbedder( | |
17 WebContentsImpl* web_contents, | |
18 RenderViewHost* render_view_host) | |
19 : BrowserPluginEmbedder(web_contents, render_view_host) { | |
20 } | |
21 | |
22 TestBrowserPluginEmbedder::~TestBrowserPluginEmbedder() { | |
23 } | |
24 | |
25 void TestBrowserPluginEmbedder::AddGuest(int instance_id, | |
26 WebContents* guest_web_contents, | |
27 int64 frame_id) { | |
28 BrowserPluginEmbedder::AddGuest(instance_id, guest_web_contents, frame_id); | |
29 if (message_loop_runner_) | |
30 message_loop_runner_->Quit(); | |
31 } | |
32 | |
33 void TestBrowserPluginEmbedder::WaitForGuestAdded() { | |
34 // Check if guests were already created. | |
35 if (guest_web_contents_by_instance_id_.size() > 0) | |
36 return; | |
37 // Wait otherwise. | |
38 message_loop_runner_ = new MessageLoopRunner(); | |
39 message_loop_runner_->Run(); | |
40 } | |
41 | |
42 } // namespace content | |
OLD | NEW |