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

Unified Diff: content/browser/android/render_widget_host_connector_browsertest.h

Issue 2792063003: Factor out RenderWidgetHostConnector (Closed)
Patch Set: base::ObserverList Created 3 years, 8 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/android/render_widget_host_connector_browsertest.h
diff --git a/content/browser/android/render_widget_host_connector_browsertest.h b/content/browser/android/render_widget_host_connector_browsertest.h
new file mode 100644
index 0000000000000000000000000000000000000000..0e7d7e1e866c2c3512a8eb1ca987a20c727911f0
--- /dev/null
+++ b/content/browser/android/render_widget_host_connector_browsertest.h
@@ -0,0 +1,52 @@
+// Copyright 2017 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_ANDROID_RENDER_WIDGET_HOST_CONNECTOR_BROWSERTEST_H_
+#define CONTENT_BROWSER_ANDROID_RENDER_WIDGET_HOST_CONNECTOR_BROWSERTEST_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "content/browser/android/ime_adapter_android.h"
+#include "content/browser/renderer_host/render_widget_host_view_android.h"
+#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/test/content_browser_test.h"
+#include "content/shell/browser/shell.h"
+
+namespace content {
+
+class RenderWidgetHostConnectorTest : public ContentBrowserTest {
+ public:
+ RenderWidgetHostConnectorTest();
+
+ protected:
+ void SetUpOnMainThread() override;
+
+ WebContentsImpl* web_contents() const {
+ return static_cast<WebContentsImpl*>(shell()->web_contents());
+ }
+
+ RenderWidgetHostViewAndroid* render_widget_host_view_android() const {
+ return static_cast<RenderWidgetHostViewAndroid*>(
+ web_contents()->GetRenderWidgetHostView());
+ }
+
+ RenderWidgetHostConnector* render_widget_host_connector() const {
+ return connector_in_rwhva(render_widget_host_view_android());
+ }
+
+ RenderWidgetHostConnector* connector_in_rwhva(
+ RenderWidgetHostViewAndroid* rwhva) const {
+ // Use ImeAdapterAndroid that inherits RenderWidgetHostConnector for
+ // testing.
+ return rwhva->ime_adapter_for_testing();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostConnectorTest);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_ANDROID_RENDER_WIDGET_HOST_CONNECTOR_BROWSERTEST_H_

Powered by Google App Engine
This is Rietveld 408576698