OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/test/render_view_test.h" | 5 #include "chrome/test/render_view_test.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 7 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
8 #include "chrome/common/extensions/extension.h" | 8 #include "chrome/common/extensions/extension.h" |
9 #include "chrome/common/native_web_keyboard_event.h" | 9 #include "chrome/common/native_web_keyboard_event.h" |
10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 GetMainFrame()->loadRequest(WebURLRequest(url)); | 55 GetMainFrame()->loadRequest(WebURLRequest(url)); |
56 | 56 |
57 // The load actually happens asynchronously, so we pump messages to process | 57 // The load actually happens asynchronously, so we pump messages to process |
58 // the pending continuation. | 58 // the pending continuation. |
59 ProcessPendingMessages(); | 59 ProcessPendingMessages(); |
60 } | 60 } |
61 | 61 |
62 void RenderViewTest::SetUp() { | 62 void RenderViewTest::SetUp() { |
63 sandbox_init_wrapper_.reset(new SandboxInitWrapper()); | 63 sandbox_init_wrapper_.reset(new SandboxInitWrapper()); |
64 #if defined(OS_WIN) | 64 command_line_.reset(new CommandLine(CommandLine::ARGUMENTS_ONLY)); |
65 command_line_.reset(new CommandLine(std::wstring())); | |
66 #elif defined(OS_POSIX) | |
67 command_line_.reset(new CommandLine(std::vector<std::string>())); | |
68 #endif | |
69 params_.reset(new MainFunctionParams(*command_line_, *sandbox_init_wrapper_, | 65 params_.reset(new MainFunctionParams(*command_line_, *sandbox_init_wrapper_, |
70 NULL)); | 66 NULL)); |
71 platform_.reset(new RendererMainPlatformDelegate(*params_)); | 67 platform_.reset(new RendererMainPlatformDelegate(*params_)); |
72 platform_->PlatformInitialize(); | 68 platform_->PlatformInitialize(); |
73 | 69 |
74 // Setting flags and really doing anything with WebKit is fairly fragile and | 70 // Setting flags and really doing anything with WebKit is fairly fragile and |
75 // hacky, but this is the world we live in... | 71 // hacky, but this is the world we live in... |
76 webkit_glue::SetJavaScriptFlags(L" --expose-gc"); | 72 webkit_glue::SetJavaScriptFlags(L" --expose-gc"); |
77 WebKit::initialize(&webkitclient_); | 73 WebKit::initialize(&webkitclient_); |
78 WebScriptController::registerExtension(BaseJsV8Extension::Get()); | 74 WebScriptController::registerExtension(BaseJsV8Extension::Get()); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 #endif | 171 #endif |
176 } | 172 } |
177 | 173 |
178 void RenderViewTest::SendNativeKeyEvent( | 174 void RenderViewTest::SendNativeKeyEvent( |
179 const NativeWebKeyboardEvent& key_event) { | 175 const NativeWebKeyboardEvent& key_event) { |
180 scoped_ptr<IPC::Message> input_message(new ViewMsg_HandleInputEvent(0)); | 176 scoped_ptr<IPC::Message> input_message(new ViewMsg_HandleInputEvent(0)); |
181 input_message->WriteData(reinterpret_cast<const char*>(&key_event), | 177 input_message->WriteData(reinterpret_cast<const char*>(&key_event), |
182 sizeof(WebKit::WebKeyboardEvent)); | 178 sizeof(WebKit::WebKeyboardEvent)); |
183 view_->OnHandleInputEvent(*input_message); | 179 view_->OnHandleInputEvent(*input_message); |
184 } | 180 } |
OLD | NEW |