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