| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "base/test/scoped_async_task_scheduler.h" |
| 16 #include "base/test/test_io_thread.h" | 17 #include "base/test/test_io_thread.h" |
| 17 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 18 #include "content/public/browser/native_web_keyboard_event.h" | 19 #include "content/public/browser/native_web_keyboard_event.h" |
| 19 #include "content/public/common/main_function_params.h" | 20 #include "content/public/common/main_function_params.h" |
| 20 #include "content/public/common/page_state.h" | 21 #include "content/public/common/page_state.h" |
| 21 #include "content/public/test/mock_render_thread.h" | 22 #include "content/public/test/mock_render_thread.h" |
| 22 #include "mojo/edk/embedder/scoped_ipc_support.h" | 23 #include "mojo/edk/embedder/scoped_ipc_support.h" |
| 23 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
| 24 #include "third_party/WebKit/public/platform/Platform.h" | 25 #include "third_party/WebKit/public/platform/Platform.h" |
| 25 #include "third_party/WebKit/public/web/WebFrame.h" | 26 #include "third_party/WebKit/public/web/WebFrame.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 virtual std::unique_ptr<ResizeParams> InitialSizeParams(); | 184 virtual std::unique_ptr<ResizeParams> InitialSizeParams(); |
| 184 | 185 |
| 185 // testing::Test | 186 // testing::Test |
| 186 void SetUp() override; | 187 void SetUp() override; |
| 187 | 188 |
| 188 void TearDown() override; | 189 void TearDown() override; |
| 189 | 190 |
| 190 // blink::WebLeakDetectorClient implementation. | 191 // blink::WebLeakDetectorClient implementation. |
| 191 void onLeakDetectionComplete(const Result& result) override; | 192 void onLeakDetectionComplete(const Result& result) override; |
| 192 | 193 |
| 194 private: |
| 193 base::MessageLoop msg_loop_; | 195 base::MessageLoop msg_loop_; |
| 196 |
| 197 // Required by gin::V8Platform::CallOnBackgroundThread(). Can't be a |
| 198 // ScopedTaskScheduler because v8 synchronously waits for tasks to run. |
| 199 base::test::ScopedAsyncTaskScheduler scoped_async_task_scheduler_; |
| 200 |
| 201 protected: |
| 194 std::unique_ptr<FakeCompositorDependencies> compositor_deps_; | 202 std::unique_ptr<FakeCompositorDependencies> compositor_deps_; |
| 195 std::unique_ptr<MockRenderProcess> mock_process_; | 203 std::unique_ptr<MockRenderProcess> mock_process_; |
| 196 // We use a naked pointer because we don't want to expose RenderViewImpl in | 204 // We use a naked pointer because we don't want to expose RenderViewImpl in |
| 197 // the embedder's namespace. | 205 // the embedder's namespace. |
| 198 RenderView* view_; | 206 RenderView* view_; |
| 199 RendererBlinkPlatformImplTestOverride blink_platform_impl_; | 207 RendererBlinkPlatformImplTestOverride blink_platform_impl_; |
| 200 std::unique_ptr<ContentClient> content_client_; | 208 std::unique_ptr<ContentClient> content_client_; |
| 201 std::unique_ptr<ContentBrowserClient> content_browser_client_; | 209 std::unique_ptr<ContentBrowserClient> content_browser_client_; |
| 202 std::unique_ptr<ContentRendererClient> content_renderer_client_; | 210 std::unique_ptr<ContentRendererClient> content_renderer_client_; |
| 203 std::unique_ptr<MockRenderThread> render_thread_; | 211 std::unique_ptr<MockRenderThread> render_thread_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 216 std::unique_ptr<base::mac::ScopedNSAutoreleasePool> autorelease_pool_; | 224 std::unique_ptr<base::mac::ScopedNSAutoreleasePool> autorelease_pool_; |
| 217 #endif | 225 #endif |
| 218 | 226 |
| 219 private: | 227 private: |
| 220 void GoToOffset(int offset, const GURL& url, const PageState& state); | 228 void GoToOffset(int offset, const GURL& url, const PageState& state); |
| 221 }; | 229 }; |
| 222 | 230 |
| 223 } // namespace content | 231 } // namespace content |
| 224 | 232 |
| 225 #endif // CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ | 233 #endif // CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ |
| OLD | NEW |