IndexedDBFactory now ForceCloses databases.
[chromium-blink-merge.git] / content / browser / browser_plugin / test_browser_plugin_embedder.h
blob4673f9263052fefdbe7479410179b230e1a20c24
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.
5 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_TEST_BROWSER_PLUGIN_EMBEDDER_H_
6 #define CONTENT_BROWSER_BROWSER_PLUGIN_TEST_BROWSER_PLUGIN_EMBEDDER_H_
8 #include "base/compiler_specific.h"
9 #include "content/browser/browser_plugin/browser_plugin_embedder.h"
10 #include "content/public/test/test_utils.h"
12 namespace content {
14 class BrowserPluginGuest;
15 class RenderViewHost;
16 class WebContentsImpl;
18 // 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 virtual ~TestBrowserPluginEmbedder();
27 // Asks the renderer process for RenderViewHost at (|x|, |y|) and waits until
28 // the response arrives.
29 void WaitForRenderViewHostAtPosition(int x, int y);
30 RenderViewHost* last_rvh_at_position_response() {
31 return last_rvh_at_position_response_;
34 WebContentsImpl* web_contents() const;
36 private:
37 void GetRenderViewHostCallback(RenderViewHost* rvh, int x, int y);
39 scoped_refptr<MessageLoopRunner> message_loop_runner_;
40 RenderViewHost* last_rvh_at_position_response_;
42 DISALLOW_COPY_AND_ASSIGN(TestBrowserPluginEmbedder);
45 } // namespace content
47 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_TEST_BROWSER_PLUGIN_EMBEDDER_H_