| 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 #include "content/public/test/render_view_test.h" | 5 #include "content/public/test/render_view_test.h" |
| 6 | 6 |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "content/common/dom_storage/dom_storage_types.h" | 8 #include "content/common/dom_storage/dom_storage_types.h" |
| 9 #include "content/common/frame_messages.h" | 9 #include "content/common/frame_messages.h" |
| 10 #include "content/common/input_messages.h" | 10 #include "content/common/input_messages.h" |
| 11 #include "content/common/view_messages.h" | 11 #include "content/common/view_messages.h" |
| 12 #include "content/public/browser/content_browser_client.h" | 12 #include "content/public/browser/content_browser_client.h" |
| 13 #include "content/public/browser/native_web_keyboard_event.h" | 13 #include "content/public/browser/native_web_keyboard_event.h" |
| 14 #include "content/public/common/content_client.h" | 14 #include "content/public/common/content_client.h" |
| 15 #include "content/public/common/renderer_preferences.h" | 15 #include "content/public/common/renderer_preferences.h" |
| 16 #include "content/public/renderer/content_renderer_client.h" | 16 #include "content/public/renderer/content_renderer_client.h" |
| 17 #include "content/public/test/frame_load_waiter.h" | 17 #include "content/public/test/frame_load_waiter.h" |
| 18 #include "content/renderer/history_controller.h" | 18 #include "content/renderer/history_controller.h" |
| 19 #include "content/renderer/history_serialization.h" | 19 #include "content/renderer/history_serialization.h" |
| 20 #include "content/renderer/render_thread_impl.h" | 20 #include "content/renderer/render_thread_impl.h" |
| 21 #include "content/renderer/render_view_impl.h" | 21 #include "content/renderer/render_view_impl.h" |
| 22 #include "content/renderer/renderer_blink_platform_impl.h" | 22 #include "content/renderer/renderer_blink_platform_impl.h" |
| 23 #include "content/renderer/renderer_main_platform_delegate.h" | 23 #include "content/renderer/renderer_main_platform_delegate.h" |
| 24 #include "content/renderer/scheduler/renderer_scheduler.h" |
| 24 #include "content/test/mock_render_process.h" | 25 #include "content/test/mock_render_process.h" |
| 25 #include "content/test/test_content_client.h" | 26 #include "content/test/test_content_client.h" |
| 26 #include "third_party/WebKit/public/platform/WebScreenInfo.h" | 27 #include "third_party/WebKit/public/platform/WebScreenInfo.h" |
| 27 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 28 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 28 #include "third_party/WebKit/public/web/WebHistoryItem.h" | 29 #include "third_party/WebKit/public/web/WebHistoryItem.h" |
| 29 #include "third_party/WebKit/public/web/WebInputEvent.h" | 30 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 30 #include "third_party/WebKit/public/web/WebKit.h" | 31 #include "third_party/WebKit/public/web/WebKit.h" |
| 31 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 32 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 32 #include "third_party/WebKit/public/web/WebScriptSource.h" | 33 #include "third_party/WebKit/public/web/WebScriptSource.h" |
| 33 #include "third_party/WebKit/public/web/WebView.h" | 34 #include "third_party/WebKit/public/web/WebView.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 53 const int32 kNewFrameRouteId = 10; | 54 const int32 kNewFrameRouteId = 10; |
| 54 const int32 kSurfaceId = 42; | 55 const int32 kSurfaceId = 42; |
| 55 | 56 |
| 56 } // namespace | 57 } // namespace |
| 57 | 58 |
| 58 namespace content { | 59 namespace content { |
| 59 | 60 |
| 60 class RendererBlinkPlatformImplNoSandboxImpl | 61 class RendererBlinkPlatformImplNoSandboxImpl |
| 61 : public RendererBlinkPlatformImpl { | 62 : public RendererBlinkPlatformImpl { |
| 62 public: | 63 public: |
| 64 RendererBlinkPlatformImplNoSandboxImpl(RendererScheduler* scheduler) |
| 65 : RendererBlinkPlatformImpl(scheduler) {} |
| 66 |
| 63 virtual blink::WebSandboxSupport* sandboxSupport() { | 67 virtual blink::WebSandboxSupport* sandboxSupport() { |
| 64 return NULL; | 68 return NULL; |
| 65 } | 69 } |
| 66 }; | 70 }; |
| 67 | 71 |
| 68 RenderViewTest::RendererBlinkPlatformImplNoSandbox:: | 72 RenderViewTest::RendererBlinkPlatformImplNoSandbox:: |
| 69 RendererBlinkPlatformImplNoSandbox() { | 73 RendererBlinkPlatformImplNoSandbox() { |
| 70 blink_platform_impl_.reset(new RendererBlinkPlatformImplNoSandboxImpl()); | 74 renderer_scheduler_ = RendererScheduler::Create(); |
| 75 blink_platform_impl_.reset( |
| 76 new RendererBlinkPlatformImplNoSandboxImpl(renderer_scheduler_.get())); |
| 71 } | 77 } |
| 72 | 78 |
| 73 RenderViewTest::RendererBlinkPlatformImplNoSandbox:: | 79 RenderViewTest::RendererBlinkPlatformImplNoSandbox:: |
| 74 ~RendererBlinkPlatformImplNoSandbox() { | 80 ~RendererBlinkPlatformImplNoSandbox() { |
| 75 } | 81 } |
| 76 | 82 |
| 77 blink::Platform* RenderViewTest::RendererBlinkPlatformImplNoSandbox::Get() { | 83 blink::Platform* RenderViewTest::RendererBlinkPlatformImplNoSandbox::Get() { |
| 78 return blink_platform_impl_.get(); | 84 return blink_platform_impl_.get(); |
| 79 } | 85 } |
| 80 | 86 |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 FrameMsg_Navigate navigate_message(impl->GetMainRenderFrame()->GetRoutingID(), | 428 FrameMsg_Navigate navigate_message(impl->GetMainRenderFrame()->GetRoutingID(), |
| 423 navigate_params); | 429 navigate_params); |
| 424 impl->GetMainRenderFrame()->OnMessageReceived(navigate_message); | 430 impl->GetMainRenderFrame()->OnMessageReceived(navigate_message); |
| 425 | 431 |
| 426 // The load actually happens asynchronously, so we pump messages to process | 432 // The load actually happens asynchronously, so we pump messages to process |
| 427 // the pending continuation. | 433 // the pending continuation. |
| 428 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); | 434 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); |
| 429 } | 435 } |
| 430 | 436 |
| 431 } // namespace content | 437 } // namespace content |
| OLD | NEW |