| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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_ANDROID_RENDER_WIDGET_HOST_CONNECTOR_BROWSERTEST_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_RENDER_WIDGET_HOST_CONNECTOR_BROWSERTEST_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "content/browser/android/ime_adapter_android.h" |
| 12 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 13 #include "content/browser/web_contents/web_contents_impl.h" |
| 14 #include "content/public/test/content_browser_test.h" |
| 15 #include "content/shell/browser/shell.h" |
| 16 |
| 17 namespace content { |
| 18 |
| 19 class RenderWidgetHostConnectorTest : public ContentBrowserTest { |
| 20 public: |
| 21 RenderWidgetHostConnectorTest(); |
| 22 |
| 23 protected: |
| 24 void SetUpOnMainThread() override; |
| 25 |
| 26 WebContentsImpl* web_contents() const { |
| 27 return static_cast<WebContentsImpl*>(shell()->web_contents()); |
| 28 } |
| 29 |
| 30 RenderWidgetHostViewAndroid* render_widget_host_view_android() const { |
| 31 return static_cast<RenderWidgetHostViewAndroid*>( |
| 32 web_contents()->GetRenderWidgetHostView()); |
| 33 } |
| 34 |
| 35 RenderWidgetHostConnector* render_widget_host_connector() const { |
| 36 return connector_in_rwhva(render_widget_host_view_android()); |
| 37 } |
| 38 |
| 39 RenderWidgetHostConnector* connector_in_rwhva( |
| 40 RenderWidgetHostViewAndroid* rwhva) const { |
| 41 // Use ImeAdapterAndroid that inherits RenderWidgetHostConnector for |
| 42 // testing. |
| 43 return rwhva->ime_adapter_for_testing(); |
| 44 } |
| 45 |
| 46 private: |
| 47 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostConnectorTest); |
| 48 }; |
| 49 |
| 50 } // namespace content |
| 51 |
| 52 #endif // CONTENT_BROWSER_ANDROID_RENDER_WIDGET_HOST_CONNECTOR_BROWSERTEST_H_ |
| OLD | NEW |