| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_TEST_RENDER_VIEW_TEST_H_ | 5 #ifndef CHROME_TEST_RENDER_VIEW_TEST_H_ |
| 6 #define CHROME_TEST_RENDER_VIEW_TEST_H_ | 6 #define CHROME_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/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "chrome/common/main_function_params.h" | 12 #include "chrome/common/main_function_params.h" |
| 13 #include "chrome/common/sandbox_init_wrapper.h" | 13 #include "chrome/common/sandbox_init_wrapper.h" |
| 14 #include "chrome/renderer/mock_keyboard.h" | 14 #include "chrome/renderer/mock_keyboard.h" |
| 15 #include "chrome/renderer/mock_render_process.h" | 15 #include "chrome/renderer/mock_render_process.h" |
| 16 #include "chrome/renderer/mock_render_thread.h" | 16 #include "chrome/renderer/mock_render_thread.h" |
| 17 #include "chrome/renderer/render_view.h" | 17 #include "chrome/renderer/render_view.h" |
| 18 #include "chrome/renderer/renderer_main_platform_delegate.h" | 18 #include "chrome/renderer/renderer_main_platform_delegate.h" |
| 19 #include "chrome/renderer/renderer_webkitclient_impl.h" | 19 #include "chrome/renderer/renderer_webkitclient_impl.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 21 #include "webkit/glue/webframe.h" | 21 #include "webkit/api/public/WebFrame.h" |
| 22 | 22 |
| 23 class RenderViewTest : public testing::Test { | 23 class RenderViewTest : public testing::Test { |
| 24 public: | 24 public: |
| 25 RenderViewTest() {} | 25 RenderViewTest() {} |
| 26 ~RenderViewTest() {} | 26 ~RenderViewTest() {} |
| 27 | 27 |
| 28 protected: | 28 protected: |
| 29 // Spins the message loop to process all messages that are currently pending. | 29 // Spins the message loop to process all messages that are currently pending. |
| 30 void ProcessPendingMessages(); | 30 void ProcessPendingMessages(); |
| 31 | 31 |
| 32 // Returns a pointer to the main frame. | 32 // Returns a pointer to the main frame. |
| 33 WebFrame* GetMainFrame(); | 33 WebKit::WebFrame* GetMainFrame(); |
| 34 | 34 |
| 35 // Executes the given JavaScript in the context of the main frame. The input | 35 // Executes the given JavaScript in the context of the main frame. The input |
| 36 // is a NULL-terminated UTF-8 string. | 36 // is a NULL-terminated UTF-8 string. |
| 37 void ExecuteJavaScript(const char* js); | 37 void ExecuteJavaScript(const char* js); |
| 38 | 38 |
| 39 // Loads the given HTML into the main frame as a data: URL. | 39 // Loads the given HTML into the main frame as a data: URL. |
| 40 void LoadHTML(const char* html); | 40 void LoadHTML(const char* html); |
| 41 | 41 |
| 42 // Sends IPC messages that emulates a key-press event. | 42 // Sends IPC messages that emulates a key-press event. |
| 43 int SendKeyEvent(MockKeyboard::Layout layout, | 43 int SendKeyEvent(MockKeyboard::Layout layout, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 58 scoped_ptr<MockKeyboard> mock_keyboard_; | 58 scoped_ptr<MockKeyboard> mock_keyboard_; |
| 59 | 59 |
| 60 // Used to setup the process so renderers can run. | 60 // Used to setup the process so renderers can run. |
| 61 scoped_ptr<RendererMainPlatformDelegate> platform_; | 61 scoped_ptr<RendererMainPlatformDelegate> platform_; |
| 62 scoped_ptr<MainFunctionParams> params_; | 62 scoped_ptr<MainFunctionParams> params_; |
| 63 scoped_ptr<CommandLine> command_line_; | 63 scoped_ptr<CommandLine> command_line_; |
| 64 scoped_ptr<SandboxInitWrapper> sandbox_init_wrapper_; | 64 scoped_ptr<SandboxInitWrapper> sandbox_init_wrapper_; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 #endif // CHROME_TEST_RENDER_VIEW_TEST_H_ | 67 #endif // CHROME_TEST_RENDER_VIEW_TEST_H_ |
| OLD | NEW |