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 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_TEST_BROWSER_PLUGIN_EMBEDDER_H_ |
| 6 #define CONTENT_BROWSER_BROWSER_PLUGIN_TEST_BROWSER_PLUGIN_EMBEDDER_H_ |
| 7 |
| 8 #include "base/compiler_specific.h" |
| 9 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
| 10 #include "content/public/test/test_utils.h" |
| 11 |
| 12 class WebContentsImpl; |
| 13 |
| 14 namespace content { |
| 15 |
| 16 class BrowserPluginGuest; |
| 17 class RenderViewHost; |
| 18 |
| 19 // Test class for BrowserPluginEmbedder. |
| 20 // Provides utilities to wait for certain state/messages in |
| 21 // BrowserPluginEmbedder to be used in tests. |
| 22 class TestBrowserPluginEmbedder : public BrowserPluginEmbedder { |
| 23 public: |
| 24 TestBrowserPluginEmbedder(WebContentsImpl* web_contents, |
| 25 RenderViewHost* render_view_host); |
| 26 virtual ~TestBrowserPluginEmbedder(); |
| 27 |
| 28 const ContainerInstanceMap& guests_for_testing() const { |
| 29 return guests_by_instance_id_; |
| 30 } |
| 31 |
| 32 // Waits until at least one guest is added to this embedder. |
| 33 void WaitForGuestAdded(); |
| 34 |
| 35 private: |
| 36 // Overriden to intercept in test. |
| 37 virtual void AddGuest(int instance_id, |
| 38 BrowserPluginGuest* guest, |
| 39 int64 frame_id) OVERRIDE; |
| 40 |
| 41 scoped_refptr<MessageLoopRunner> message_loop_runner_; |
| 42 int guest_count_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(TestBrowserPluginEmbedder); |
| 45 }; |
| 46 |
| 47 } // namespace content |
| 48 |
| 49 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_TEST_BROWSER_PLUGIN_EMBEDDER_H_ |
OLD | NEW |