| 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 // | |
| 21 // Provides utilities to wait for certain state/messages in | |
| 22 // BrowserPluginEmbedder to be used in tests. | |
| 23 class TestBrowserPluginEmbedder : public BrowserPluginEmbedder { | |
| 24 public: | |
| 25 TestBrowserPluginEmbedder(WebContentsImpl* web_contents, | |
| 26 RenderViewHost* render_view_host); | |
| 27 virtual ~TestBrowserPluginEmbedder(); | |
| 28 | |
| 29 const ContainerInstanceMap& guest_web_contents_for_testing() const { | |
| 30 return guest_web_contents_by_instance_id_; | |
| 31 } | |
| 32 | |
| 33 // Waits until at least one guest is added to this embedder. | |
| 34 void WaitForGuestAdded(); | |
| 35 | |
| 36 private: | |
| 37 // Overridden to intercept in test. | |
| 38 virtual void AddGuest(int instance_id, | |
| 39 WebContents* guest_web_contents, | |
| 40 int64 frame_id) OVERRIDE; | |
| 41 | |
| 42 scoped_refptr<MessageLoopRunner> message_loop_runner_; | |
| 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 |