| 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_TEST_RENDER_VIEW_TEST_H_ | 5 #ifndef CONTENT_TEST_RENDER_VIEW_TEST_H_ |
| 6 #define CONTENT_TEST_RENDER_VIEW_TEST_H_ | 6 #define CONTENT_TEST_RENDER_VIEW_TEST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "base/string16.h" | 14 #include "base/string16.h" |
| 15 #include "content/public/browser/native_web_keyboard_event.h" | 15 #include "content/public/browser/native_web_keyboard_event.h" |
| 16 #include "content/public/common/main_function_params.h" | 16 #include "content/public/common/main_function_params.h" |
| 17 #include "content/renderer/mock_content_renderer_client.h" | 17 #include "content/renderer/mock_content_renderer_client.h" |
| 18 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | |
| 19 #include "content/test/mock_keyboard.h" | 18 #include "content/test/mock_keyboard.h" |
| 20 #include "content/test/mock_render_thread.h" | 19 #include "content/test/mock_render_thread.h" |
| 20 #include "content/test/render_test_utils.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 23 | 23 |
| 24 class MockRenderProcess; | 24 class MockRenderProcess; |
| 25 class RendererMainPlatformDelegate; | 25 class RendererMainPlatformDelegate; |
| 26 | 26 |
| 27 namespace WebKit { | 27 namespace WebKit { |
| 28 class WebHistoryItem; | 28 class WebHistoryItem; |
| 29 class WebWidget; | 29 class WebWidget; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace content { | 32 namespace content { |
| 33 class RenderView; | 33 class RenderView; |
| 34 } | 34 } |
| 35 | 35 |
| 36 namespace gfx { | 36 namespace gfx { |
| 37 class Rect; | 37 class Rect; |
| 38 } | 38 } |
| 39 | 39 |
| 40 namespace content { | 40 namespace content { |
| 41 | 41 |
| 42 class RenderViewTest : public testing::Test { | 42 class RenderViewTest : public testing::Test { |
| 43 public: | 43 public: |
| 44 // A special WebKitPlatformSupportImpl class for getting rid off the | |
| 45 // dependency to the sandbox, which is not available in RenderViewTest. | |
| 46 class RendererWebKitPlatformSupportImplNoSandbox : | |
| 47 public RendererWebKitPlatformSupportImpl { | |
| 48 public: | |
| 49 virtual WebKit::WebSandboxSupport* sandboxSupport() { | |
| 50 return NULL; | |
| 51 } | |
| 52 }; | |
| 53 | |
| 54 RenderViewTest(); | 44 RenderViewTest(); |
| 55 virtual ~RenderViewTest(); | 45 virtual ~RenderViewTest(); |
| 56 | 46 |
| 57 protected: | 47 protected: |
| 58 // Spins the message loop to process all messages that are currently pending. | 48 // Spins the message loop to process all messages that are currently pending. |
| 59 void ProcessPendingMessages(); | 49 void ProcessPendingMessages(); |
| 60 | 50 |
| 61 // Returns a pointer to the main frame. | 51 // Returns a pointer to the main frame. |
| 62 WebKit::WebFrame* GetMainFrame(); | 52 WebKit::WebFrame* GetMainFrame(); |
| 63 | 53 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 scoped_ptr<content::MainFunctionParams> params_; | 133 scoped_ptr<content::MainFunctionParams> params_; |
| 144 scoped_ptr<CommandLine> command_line_; | 134 scoped_ptr<CommandLine> command_line_; |
| 145 | 135 |
| 146 private: | 136 private: |
| 147 void GoToOffset(int offset, const WebKit::WebHistoryItem& history_item); | 137 void GoToOffset(int offset, const WebKit::WebHistoryItem& history_item); |
| 148 }; | 138 }; |
| 149 | 139 |
| 150 } // namespace content | 140 } // namespace content |
| 151 | 141 |
| 152 #endif // CONTENT_TEST_RENDER_VIEW_TEST_H_ | 142 #endif // CONTENT_TEST_RENDER_VIEW_TEST_H_ |
| OLD | NEW |