| 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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "content/public/browser/native_web_keyboard_event.h" | 14 #include "content/public/browser/native_web_keyboard_event.h" |
| 15 #include "content/public/common/main_function_params.h" | 15 #include "content/public/common/main_function_params.h" |
| 16 #include "content/public/common/page_state.h" | 16 #include "content/public/common/page_state.h" |
| 17 #include "content/public/test/mock_render_thread.h" | 17 #include "content/public/test/mock_render_thread.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 #include "third_party/WebKit/public/platform/Platform.h" | 19 #include "third_party/WebKit/public/platform/Platform.h" |
| 20 #include "third_party/WebKit/public/web/WebFrame.h" | 20 #include "third_party/WebKit/public/web/WebFrame.h" |
| 21 | 21 |
| 22 struct ViewMsg_Resize_Params; | 22 struct ViewMsg_Resize_Params; |
| 23 | 23 |
| 24 namespace blink { | 24 namespace blink { |
| 25 class WebInputElement; |
| 25 class WebWidget; | 26 class WebWidget; |
| 26 } | 27 } |
| 27 | 28 |
| 28 namespace gfx { | 29 namespace gfx { |
| 29 class Rect; | 30 class Rect; |
| 30 } | 31 } |
| 31 | 32 |
| 32 namespace content { | 33 namespace content { |
| 33 class ContentBrowserClient; | 34 class ContentBrowserClient; |
| 34 class ContentClient; | 35 class ContentClient; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 void Reload(const GURL& url); | 121 void Reload(const GURL& url); |
| 121 | 122 |
| 122 // Returns the IPC message ID of the navigation message. | 123 // Returns the IPC message ID of the navigation message. |
| 123 uint32 GetNavigationIPCType(); | 124 uint32 GetNavigationIPCType(); |
| 124 | 125 |
| 125 // Resize the view. | 126 // Resize the view. |
| 126 void Resize(gfx::Size new_size, | 127 void Resize(gfx::Size new_size, |
| 127 gfx::Rect resizer_rect, | 128 gfx::Rect resizer_rect, |
| 128 bool is_fullscreen); | 129 bool is_fullscreen); |
| 129 | 130 |
| 131 // Simulate typing the |ascii_character| into the browser. Also accepts |
| 132 // ui::VKEY_BACK for backspace. |
| 133 void SimulateUserTypingASCIICharacter(char ascii_character); |
| 134 |
| 135 // Should be called after SimulateUserTypingASCIICharacter calls to process |
| 136 // the input for autofill. |
| 137 void ProcessInputForAutofill(); |
| 138 |
| 139 // Simulates user focusing |input|, erasing all text, and typing the |
| 140 // |new_value| instead. Will process input events for autofill. This is a user |
| 141 // gesture. |
| 142 void SimulateUserInputChangeForElement(blink::WebInputElement* input, |
| 143 const std::string& new_value); |
| 144 |
| 130 // These are all methods from RenderViewImpl that we expose to testing code. | 145 // These are all methods from RenderViewImpl that we expose to testing code. |
| 131 bool OnMessageReceived(const IPC::Message& msg); | 146 bool OnMessageReceived(const IPC::Message& msg); |
| 132 void DidNavigateWithinPage(blink::WebLocalFrame* frame, | 147 void DidNavigateWithinPage(blink::WebLocalFrame* frame, |
| 133 bool is_new_navigation); | 148 bool is_new_navigation); |
| 134 void SendContentStateImmediately(); | 149 void SendContentStateImmediately(); |
| 135 blink::WebWidget* GetWebWidget(); | 150 blink::WebWidget* GetWebWidget(); |
| 136 | 151 |
| 137 // Allows a subclass to override the various content client implementations. | 152 // Allows a subclass to override the various content client implementations. |
| 138 virtual ContentClient* CreateContentClient(); | 153 virtual ContentClient* CreateContentClient(); |
| 139 virtual ContentBrowserClient* CreateContentBrowserClient(); | 154 virtual ContentBrowserClient* CreateContentBrowserClient(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 163 scoped_ptr<RendererMainPlatformDelegate> platform_; | 178 scoped_ptr<RendererMainPlatformDelegate> platform_; |
| 164 scoped_ptr<MainFunctionParams> params_; | 179 scoped_ptr<MainFunctionParams> params_; |
| 165 scoped_ptr<base::CommandLine> command_line_; | 180 scoped_ptr<base::CommandLine> command_line_; |
| 166 | 181 |
| 167 #if defined(OS_MACOSX) | 182 #if defined(OS_MACOSX) |
| 168 scoped_ptr<base::mac::ScopedNSAutoreleasePool> autorelease_pool_; | 183 scoped_ptr<base::mac::ScopedNSAutoreleasePool> autorelease_pool_; |
| 169 #endif | 184 #endif |
| 170 | 185 |
| 171 private: | 186 private: |
| 172 void GoToOffset(int offset, const PageState& state); | 187 void GoToOffset(int offset, const PageState& state); |
| 188 void LayoutMainFrame(); |
| 173 }; | 189 }; |
| 174 | 190 |
| 175 } // namespace content | 191 } // namespace content |
| 176 | 192 |
| 177 #endif // CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ | 193 #endif // CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ |
| OLD | NEW |