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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 std::vector<std::string> permissions( | 89 std::vector<std::string> permissions( |
90 Extension::kPermissionNames, | 90 Extension::kPermissionNames, |
91 Extension::kPermissionNames + Extension::kNumPermissions); | 91 Extension::kPermissionNames + Extension::kNumPermissions); |
92 ExtensionProcessBindings::SetAPIPermissions("", permissions); | 92 ExtensionProcessBindings::SetAPIPermissions("", permissions); |
93 | 93 |
94 mock_process_.reset(new MockProcess()); | 94 mock_process_.reset(new MockProcess()); |
95 | 95 |
96 render_thread_.set_routing_id(kRouteId); | 96 render_thread_.set_routing_id(kRouteId); |
97 | 97 |
98 // This needs to pass the mock render thread to the view. | 98 // This needs to pass the mock render thread to the view. |
99 view_ = RenderView::Create(&render_thread_, NULL, kOpenerId, | 99 view_ = RenderView::Create(&render_thread_, 0, kOpenerId, |
100 RendererPreferences(), WebPreferences(), | 100 RendererPreferences(), WebPreferences(), |
101 new SharedRenderViewCounter(0), kRouteId); | 101 new SharedRenderViewCounter(0), kRouteId); |
102 | 102 |
103 // Attach a pseudo keyboard device to this object. | 103 // Attach a pseudo keyboard device to this object. |
104 mock_keyboard_.reset(new MockKeyboard()); | 104 mock_keyboard_.reset(new MockKeyboard()); |
105 } | 105 } |
106 void RenderViewTest::TearDown() { | 106 void RenderViewTest::TearDown() { |
107 // Try very hard to collect garbage before shutting down. | 107 // Try very hard to collect garbage before shutting down. |
108 GetMainFrame()->collectGarbage(); | 108 GetMainFrame()->collectGarbage(); |
109 GetMainFrame()->collectGarbage(); | 109 GetMainFrame()->collectGarbage(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 #endif | 173 #endif |
174 } | 174 } |
175 | 175 |
176 void RenderViewTest::SendNativeKeyEvent( | 176 void RenderViewTest::SendNativeKeyEvent( |
177 const NativeWebKeyboardEvent& key_event) { | 177 const NativeWebKeyboardEvent& key_event) { |
178 scoped_ptr<IPC::Message> input_message(new ViewMsg_HandleInputEvent(0)); | 178 scoped_ptr<IPC::Message> input_message(new ViewMsg_HandleInputEvent(0)); |
179 input_message->WriteData(reinterpret_cast<const char*>(&key_event), | 179 input_message->WriteData(reinterpret_cast<const char*>(&key_event), |
180 sizeof(WebKit::WebKeyboardEvent)); | 180 sizeof(WebKit::WebKeyboardEvent)); |
181 view_->OnHandleInputEvent(*input_message); | 181 view_->OnHandleInputEvent(*input_message); |
182 } | 182 } |
OLD | NEW |