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/test/render_view_test.h" | 5 #include "content/test/render_view_test.h" |
6 | 6 |
7 #include "content/common/view_messages.h" | 7 #include "content/common/view_messages.h" |
8 #include "content/public/browser/native_web_keyboard_event.h" | 8 #include "content/public/browser/native_web_keyboard_event.h" |
9 #include "content/public/common/renderer_preferences.h" | 9 #include "content/public/common/renderer_preferences.h" |
10 #include "content/renderer/render_thread_impl.h" | 10 #include "content/renderer/render_thread_impl.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 using WebKit::WebFrame; | 40 using WebKit::WebFrame; |
41 using WebKit::WebInputEvent; | 41 using WebKit::WebInputEvent; |
42 using WebKit::WebMouseEvent; | 42 using WebKit::WebMouseEvent; |
43 using WebKit::WebScriptController; | 43 using WebKit::WebScriptController; |
44 using WebKit::WebScriptSource; | 44 using WebKit::WebScriptSource; |
45 using WebKit::WebString; | 45 using WebKit::WebString; |
46 using WebKit::WebURLRequest; | 46 using WebKit::WebURLRequest; |
47 | 47 |
48 namespace { | 48 namespace { |
49 const int32 kOpenerId = 7; | 49 const int32 kOpenerId = -2; |
50 const int32 kRouteId = 5; | 50 const int32 kRouteId = 5; |
51 const int32 kNewWindowRouteId = 6; | 51 const int32 kNewWindowRouteId = 6; |
52 const int32 kSurfaceId = 42; | 52 const int32 kSurfaceId = 42; |
53 | 53 |
54 #if defined(USE_AURA) && defined(USE_X11) | 54 #if defined(USE_AURA) && defined(USE_X11) |
55 // Converts MockKeyboard::Modifiers to ui::EventFlags. | 55 // Converts MockKeyboard::Modifiers to ui::EventFlags. |
56 int ConvertMockKeyboardModifier(MockKeyboard::Modifiers modifiers) { | 56 int ConvertMockKeyboardModifier(MockKeyboard::Modifiers modifiers) { |
57 static struct ModifierMap { | 57 static struct ModifierMap { |
58 MockKeyboard::Modifiers src; | 58 MockKeyboard::Modifiers src; |
59 int dst; | 59 int dst; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 RenderViewImpl* view = RenderViewImpl::Create( | 157 RenderViewImpl* view = RenderViewImpl::Create( |
158 0, | 158 0, |
159 kOpenerId, | 159 kOpenerId, |
160 content::RendererPreferences(), | 160 content::RendererPreferences(), |
161 WebPreferences(), | 161 WebPreferences(), |
162 new SharedRenderViewCounter(0), | 162 new SharedRenderViewCounter(0), |
163 kRouteId, | 163 kRouteId, |
164 kSurfaceId, | 164 kSurfaceId, |
165 dom_storage::kInvalidSessionStorageNamespaceId, | 165 dom_storage::kInvalidSessionStorageNamespaceId, |
166 string16(), | 166 string16(), |
| 167 false, |
| 168 false, |
167 1, | 169 1, |
168 WebKit::WebScreenInfo(), | 170 WebKit::WebScreenInfo(), |
169 false, | 171 false, |
170 AccessibilityModeOff); | 172 AccessibilityModeOff); |
171 view->AddRef(); | 173 view->AddRef(); |
172 view_ = view; | 174 view_ = view; |
173 | 175 |
174 // Attach a pseudo keyboard device to this object. | 176 // Attach a pseudo keyboard device to this object. |
175 mock_keyboard_.reset(new MockKeyboard()); | 177 mock_keyboard_.reset(new MockKeyboard()); |
176 } | 178 } |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 457 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
456 impl->set_send_content_state_immediately(true); | 458 impl->set_send_content_state_immediately(true); |
457 } | 459 } |
458 | 460 |
459 WebKit::WebWidget* RenderViewTest::GetWebWidget() { | 461 WebKit::WebWidget* RenderViewTest::GetWebWidget() { |
460 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 462 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
461 return impl->webwidget(); | 463 return impl->webwidget(); |
462 } | 464 } |
463 | 465 |
464 } // namespace content | 466 } // namespace content |
OLD | NEW |