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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cctype> | 9 #include <cctype> |
10 | 10 |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
14 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "content/app/mojo/mojo_init.h" | 17 #include "content/app/mojo/mojo_init.h" |
18 #include "content/common/dom_storage/dom_storage_types.h" | 18 #include "content/common/dom_storage/dom_storage_types.h" |
19 #include "content/common/frame_messages.h" | 19 #include "content/common/frame_messages.h" |
20 #include "content/common/input_messages.h" | 20 #include "content/common/input_messages.h" |
21 #include "content/common/renderer.mojom.h" | 21 #include "content/common/renderer.mojom.h" |
22 #include "content/common/resize_params.h" | 22 #include "content/common/resize_params.h" |
23 #include "content/common/site_isolation_policy.h" | 23 #include "content/common/site_isolation_policy.h" |
24 #include "content/common/view_messages.h" | 24 #include "content/common/view_messages.h" |
25 #include "content/public/browser/content_browser_client.h" | 25 #include "content/public/browser/content_browser_client.h" |
26 #include "content/public/browser/native_web_keyboard_event.h" | 26 #include "content/public/browser/native_web_keyboard_event.h" |
27 #include "content/public/common/content_client.h" | 27 #include "content/public/common/content_client.h" |
| 28 #include "content/public/common/content_descriptors.h" |
28 #include "content/public/common/content_switches.h" | 29 #include "content/public/common/content_switches.h" |
29 #include "content/public/common/renderer_preferences.h" | 30 #include "content/public/common/renderer_preferences.h" |
30 #include "content/public/renderer/content_renderer_client.h" | 31 #include "content/public/renderer/content_renderer_client.h" |
31 #include "content/public/test/frame_load_waiter.h" | 32 #include "content/public/test/frame_load_waiter.h" |
32 #include "content/renderer/history_controller.h" | 33 #include "content/renderer/history_controller.h" |
33 #include "content/renderer/history_serialization.h" | 34 #include "content/renderer/history_serialization.h" |
34 #include "content/renderer/render_thread_impl.h" | 35 #include "content/renderer/render_thread_impl.h" |
35 #include "content/renderer/render_view_impl.h" | 36 #include "content/renderer/render_view_impl.h" |
36 #include "content/renderer/renderer_blink_platform_impl.h" | 37 #include "content/renderer/renderer_blink_platform_impl.h" |
37 #include "content/renderer/renderer_main_platform_delegate.h" | 38 #include "content/renderer/renderer_main_platform_delegate.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 render_thread_->set_new_window_main_frame_widget_routing_id( | 267 render_thread_->set_new_window_main_frame_widget_routing_id( |
267 kNewFrameWidgetRouteId); | 268 kNewFrameWidgetRouteId); |
268 render_thread_->set_new_frame_routing_id(kNewFrameRouteId); | 269 render_thread_->set_new_frame_routing_id(kNewFrameRouteId); |
269 | 270 |
270 #if defined(OS_MACOSX) | 271 #if defined(OS_MACOSX) |
271 autorelease_pool_.reset(new base::mac::ScopedNSAutoreleasePool()); | 272 autorelease_pool_.reset(new base::mac::ScopedNSAutoreleasePool()); |
272 #endif | 273 #endif |
273 command_line_.reset(new base::CommandLine(base::CommandLine::NO_PROGRAM)); | 274 command_line_.reset(new base::CommandLine(base::CommandLine::NO_PROGRAM)); |
274 field_trial_list_.reset(new base::FieldTrialList(nullptr)); | 275 field_trial_list_.reset(new base::FieldTrialList(nullptr)); |
275 base::FieldTrialList::CreateTrialsFromCommandLine( | 276 base::FieldTrialList::CreateTrialsFromCommandLine( |
276 *command_line_, switches::kFieldTrialHandle); | 277 *command_line_, switches::kFieldTrialHandle, kFieldTrialHandle); |
277 params_.reset(new MainFunctionParams(*command_line_)); | 278 params_.reset(new MainFunctionParams(*command_line_)); |
278 platform_.reset(new RendererMainPlatformDelegate(*params_)); | 279 platform_.reset(new RendererMainPlatformDelegate(*params_)); |
279 platform_->PlatformInitialize(); | 280 platform_->PlatformInitialize(); |
280 | 281 |
281 // Setting flags and really doing anything with WebKit is fairly fragile and | 282 // Setting flags and really doing anything with WebKit is fairly fragile and |
282 // hacky, but this is the world we live in... | 283 // hacky, but this is the world we live in... |
283 std::string flags("--expose-gc"); | 284 std::string flags("--expose-gc"); |
284 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); | 285 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); |
285 | 286 |
286 // Ensure that we register any necessary schemes when initializing WebKit, | 287 // Ensure that we register any necessary schemes when initializing WebKit, |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 664 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
664 frame->Navigate(common_params, StartNavigationParams(), request_params); | 665 frame->Navigate(common_params, StartNavigationParams(), request_params); |
665 | 666 |
666 // The load actually happens asynchronously, so we pump messages to process | 667 // The load actually happens asynchronously, so we pump messages to process |
667 // the pending continuation. | 668 // the pending continuation. |
668 FrameLoadWaiter(frame).Wait(); | 669 FrameLoadWaiter(frame).Wait(); |
669 view_->GetWebView()->updateAllLifecyclePhases(); | 670 view_->GetWebView()->updateAllLifecyclePhases(); |
670 } | 671 } |
671 | 672 |
672 } // namespace content | 673 } // namespace content |
OLD | NEW |