Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
|
Fady Samuel
2012/08/29 08:53:07
I believe the typical naming scheme would MockBrow
lazyboy
2012/08/29 21:24:44
So these are not mock objects, they are decorated
| |
| 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 guest_count_(0) { | |
| 21 } | |
| 22 | |
| 23 TestBrowserPluginEmbedder::~TestBrowserPluginEmbedder() { | |
| 24 } | |
| 25 | |
| 26 void TestBrowserPluginEmbedder::AddGuest(int instance_id, | |
| 27 BrowserPluginGuest* guest, | |
| 28 int64 frame_id) { | |
| 29 BrowserPluginEmbedder::AddGuest(instance_id, guest, frame_id); | |
| 30 if (message_loop_runner_) | |
| 31 message_loop_runner_->Quit(); | |
| 32 } | |
| 33 | |
| 34 void TestBrowserPluginEmbedder::WaitForGuestAdded() { | |
| 35 // Check if guests were already created. | |
| 36 if (guests_by_instance_id_.size() > 0) | |
| 37 return; | |
| 38 // Wait otherwise. | |
| 39 message_loop_runner_ = new MessageLoopRunner(); | |
| 40 message_loop_runner_->Run(); | |
| 41 } | |
| 42 | |
| 43 } // namespace content | |
| OLD | NEW |