OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ |
6 #define CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ | 6 #define CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // the navigation is committed. | 72 // the navigation is committed. |
73 void LoadHTML(const char* html); | 73 void LoadHTML(const char* html); |
74 | 74 |
75 // Navigates the main frame back or forward in session history and commits. | 75 // Navigates the main frame back or forward in session history and commits. |
76 // The caller must capture a WebHistoryItem for the target page. This is | 76 // The caller must capture a WebHistoryItem for the target page. This is |
77 // available from the WebFrame. | 77 // available from the WebFrame. |
78 void GoBack(const WebKit::WebHistoryItem& item); | 78 void GoBack(const WebKit::WebHistoryItem& item); |
79 void GoForward(const WebKit::WebHistoryItem& item); | 79 void GoForward(const WebKit::WebHistoryItem& item); |
80 | 80 |
81 // Sends one native key event over IPC. | 81 // Sends one native key event over IPC. |
82 void SendNativeKeyEvent(const content::NativeWebKeyboardEvent& key_event); | 82 void SendNativeKeyEvent(const NativeWebKeyboardEvent& key_event); |
83 | 83 |
84 // Send a raw keyboard event to the renderer. | 84 // Send a raw keyboard event to the renderer. |
85 void SendWebKeyboardEvent(const WebKit::WebKeyboardEvent& key_event); | 85 void SendWebKeyboardEvent(const WebKit::WebKeyboardEvent& key_event); |
86 | 86 |
87 // Send a raw mouse event to the renderer. | 87 // Send a raw mouse event to the renderer. |
88 void SendWebMouseEvent(const WebKit::WebMouseEvent& key_event); | 88 void SendWebMouseEvent(const WebKit::WebMouseEvent& key_event); |
89 | 89 |
90 // Returns the bounds (coordinates and size) of the element with id | 90 // Returns the bounds (coordinates and size) of the element with id |
91 // |element_id|. Returns an empty rect if such an element was not found. | 91 // |element_id|. Returns an empty rect if such an element was not found. |
92 gfx::Rect GetElementBounds(const std::string& element_id); | 92 gfx::Rect GetElementBounds(const std::string& element_id); |
(...skipping 28 matching lines...) Expand all Loading... |
121 | 121 |
122 // testing::Test | 122 // testing::Test |
123 virtual void SetUp() OVERRIDE; | 123 virtual void SetUp() OVERRIDE; |
124 | 124 |
125 virtual void TearDown() OVERRIDE; | 125 virtual void TearDown() OVERRIDE; |
126 | 126 |
127 MessageLoop msg_loop_; | 127 MessageLoop msg_loop_; |
128 scoped_ptr<MockRenderProcess> mock_process_; | 128 scoped_ptr<MockRenderProcess> mock_process_; |
129 // We use a naked pointer because we don't want to expose RenderViewImpl in | 129 // We use a naked pointer because we don't want to expose RenderViewImpl in |
130 // the embedder's namespace. | 130 // the embedder's namespace. |
131 content::RenderView* view_; | 131 RenderView* view_; |
132 RendererWebKitPlatformSupportImplNoSandbox webkit_platform_support_; | 132 RendererWebKitPlatformSupportImplNoSandbox webkit_platform_support_; |
133 ContentRendererClient content_renderer_client_; | 133 ContentRendererClient content_renderer_client_; |
134 scoped_ptr<MockRenderThread> render_thread_; | 134 scoped_ptr<MockRenderThread> render_thread_; |
135 | 135 |
136 // Used to setup the process so renderers can run. | 136 // Used to setup the process so renderers can run. |
137 scoped_ptr<RendererMainPlatformDelegate> platform_; | 137 scoped_ptr<RendererMainPlatformDelegate> platform_; |
138 scoped_ptr<content::MainFunctionParams> params_; | 138 scoped_ptr<MainFunctionParams> params_; |
139 scoped_ptr<CommandLine> command_line_; | 139 scoped_ptr<CommandLine> command_line_; |
140 | 140 |
141 private: | 141 private: |
142 void GoToOffset(int offset, const WebKit::WebHistoryItem& history_item); | 142 void GoToOffset(int offset, const WebKit::WebHistoryItem& history_item); |
143 }; | 143 }; |
144 | 144 |
145 } // namespace content | 145 } // namespace content |
146 | 146 |
147 #endif // CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ | 147 #endif // CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ |
OLD | NEW |