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