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

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

Issue 10868012: Browser Plugin: New Implementation (Browser Side) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master-trial-obrowser
Patch Set: Fix mac build + Address nits from awong@ Created 8 years, 4 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.h
diff --git a/content/browser/browser_plugin/test_browser_plugin_embedder.h b/content/browser/browser_plugin/test_browser_plugin_embedder.h
new file mode 100644
index 0000000000000000000000000000000000000000..371dba6284a03d6423be3f43199b0f0aacfaa873
--- /dev/null
+++ b/content/browser/browser_plugin/test_browser_plugin_embedder.h
@@ -0,0 +1,49 @@
+// 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.
+
+#ifndef CONTENT_BROWSER_BROWSER_PLUGIN_TEST_BROWSER_PLUGIN_EMBEDDER_H_
+#define CONTENT_BROWSER_BROWSER_PLUGIN_TEST_BROWSER_PLUGIN_EMBEDDER_H_
+
+#include "base/compiler_specific.h"
+#include "content/browser/browser_plugin/browser_plugin_embedder.h"
+#include "content/public/test/test_utils.h"
+
+class WebContentsImpl;
+
+namespace content {
+
+class BrowserPluginGuest;
+class RenderViewHost;
+
+// Test class for BrowserPluginEmbedder.
+// Provides utilities to wait for certain state/messages in
+// BrowserPluginEmbedder to be used in tests.
+class TestBrowserPluginEmbedder : public BrowserPluginEmbedder {
+ public:
+ TestBrowserPluginEmbedder(WebContentsImpl* web_contents,
+ RenderViewHost* render_view_host);
+ virtual ~TestBrowserPluginEmbedder();
+
+ const ContainerInstanceMap& guests_for_testing() const {
+ return guests_by_instance_id_;
+ }
+
+ // Waits until at least one guest is added to this embedder.
+ void WaitForGuestAdded();
+
+ private:
+ // Overriden to intercept in test.
+ virtual void AddGuest(int instance_id,
+ BrowserPluginGuest* guest,
+ int64 frame_id) OVERRIDE;
+
+ scoped_refptr<MessageLoopRunner> message_loop_runner_;
+ int guest_count_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestBrowserPluginEmbedder);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_BROWSER_PLUGIN_TEST_BROWSER_PLUGIN_EMBEDDER_H_

Powered by Google App Engine
This is Rietveld 408576698