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 <cctype> | 7 #include <cctype> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
12 #include "components/scheduler/renderer/renderer_scheduler.h" | 12 #include "components/scheduler/renderer/renderer_scheduler.h" |
| 13 #include "content/app/mojo/mojo_init.h" |
13 #include "content/common/dom_storage/dom_storage_types.h" | 14 #include "content/common/dom_storage/dom_storage_types.h" |
14 #include "content/common/frame_messages.h" | 15 #include "content/common/frame_messages.h" |
15 #include "content/common/input_messages.h" | 16 #include "content/common/input_messages.h" |
16 #include "content/common/view_messages.h" | 17 #include "content/common/view_messages.h" |
17 #include "content/public/browser/content_browser_client.h" | 18 #include "content/public/browser/content_browser_client.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/content_client.h" | 20 #include "content/public/common/content_client.h" |
20 #include "content/public/common/renderer_preferences.h" | 21 #include "content/public/common/renderer_preferences.h" |
21 #include "content/public/renderer/content_renderer_client.h" | 22 #include "content/public/renderer/content_renderer_client.h" |
22 #include "content/public/test/frame_load_waiter.h" | 23 #include "content/public/test/frame_load_waiter.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 view_params.replicated_frame_state = FrameReplicationState(); | 252 view_params.replicated_frame_state = FrameReplicationState(); |
252 view_params.proxy_routing_id = MSG_ROUTING_NONE; | 253 view_params.proxy_routing_id = MSG_ROUTING_NONE; |
253 view_params.hidden = false; | 254 view_params.hidden = false; |
254 view_params.never_visible = false; | 255 view_params.never_visible = false; |
255 view_params.next_page_id = 1; | 256 view_params.next_page_id = 1; |
256 view_params.initial_size = *InitialSizeParams(); | 257 view_params.initial_size = *InitialSizeParams(); |
257 view_params.enable_auto_resize = false; | 258 view_params.enable_auto_resize = false; |
258 view_params.min_size = gfx::Size(); | 259 view_params.min_size = gfx::Size(); |
259 view_params.max_size = gfx::Size(); | 260 view_params.max_size = gfx::Size(); |
260 | 261 |
| 262 #if !defined(OS_IOS) |
| 263 InitializeMojo(); |
| 264 #endif |
| 265 |
261 // This needs to pass the mock render thread to the view. | 266 // This needs to pass the mock render thread to the view. |
262 RenderViewImpl* view = | 267 RenderViewImpl* view = |
263 RenderViewImpl::Create(compositor_deps_.get(), view_params, false); | 268 RenderViewImpl::Create(compositor_deps_.get(), view_params, false); |
264 view_ = view; | 269 view_ = view; |
265 } | 270 } |
266 | 271 |
267 void RenderViewTest::TearDown() { | 272 void RenderViewTest::TearDown() { |
268 // Try very hard to collect garbage before shutting down. | 273 // Try very hard to collect garbage before shutting down. |
269 // "5" was chosen following http://crbug.com/46571#c9 | 274 // "5" was chosen following http://crbug.com/46571#c9 |
270 const int kGCIterations = 5; | 275 const int kGCIterations = 5; |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 TestRenderFrame* frame = | 585 TestRenderFrame* frame = |
581 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 586 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
582 frame->Navigate(common_params, StartNavigationParams(), request_params); | 587 frame->Navigate(common_params, StartNavigationParams(), request_params); |
583 | 588 |
584 // The load actually happens asynchronously, so we pump messages to process | 589 // The load actually happens asynchronously, so we pump messages to process |
585 // the pending continuation. | 590 // the pending continuation. |
586 FrameLoadWaiter(frame).Wait(); | 591 FrameLoadWaiter(frame).Wait(); |
587 } | 592 } |
588 | 593 |
589 } // namespace content | 594 } // namespace content |
OLD | NEW |