Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(968)

Unified Diff: content/browser/browser_plugin/test_browser_plugin_embedder.cc

Issue 10868012: Browser Plugin: New Implementation (Browser Side) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master-trial-obrowser
Patch Set: Clean up BrowserPluginHostTest, remove unused var, use constants for str. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/browser_plugin/test_browser_plugin_embedder.cc
diff --git a/content/browser/browser_plugin/test_browser_plugin_embedder.cc b/content/browser/browser_plugin/test_browser_plugin_embedder.cc
new file mode 100644
index 0000000000000000000000000000000000000000..69f4936644d2454f658d3540926bec892bdb19c7
--- /dev/null
+++ b/content/browser/browser_plugin/test_browser_plugin_embedder.cc
@@ -0,0 +1,43 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/browser_plugin/test_browser_plugin_embedder.h"
+
+#include "base/time.h"
+#include "content/browser/browser_plugin/browser_plugin_embedder.h"
+#include "content/browser/browser_plugin/browser_plugin_guest.h"
+#include "content/browser/renderer_host/render_view_host_impl.h"
+#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/test/test_utils.h"
+
+namespace content {
+
+TestBrowserPluginEmbedder::TestBrowserPluginEmbedder(
+ WebContentsImpl* web_contents,
+ RenderViewHost* render_view_host)
+ : BrowserPluginEmbedder(web_contents, render_view_host),
+ guest_count_(0) {
awong 2012/09/09 18:08:09 What is guest_count_ used for?
lazyboy 2012/09/10 16:30:17 Removed, unused now.
+}
+
+TestBrowserPluginEmbedder::~TestBrowserPluginEmbedder() {
+}
+
+void TestBrowserPluginEmbedder::AddGuest(int instance_id,
+ BrowserPluginGuest* guest,
+ int64 frame_id) {
+ BrowserPluginEmbedder::AddGuest(instance_id, guest, frame_id);
+ if (message_loop_runner_)
+ message_loop_runner_->Quit();
+}
+
+void TestBrowserPluginEmbedder::WaitForGuestAdded() {
+ // Check if guests were already created.
+ if (guests_by_instance_id_.size() > 0)
+ return;
+ // Wait otherwise.
+ message_loop_runner_ = new MessageLoopRunner();
+ message_loop_runner_->Run();
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698