OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ppapi/tests/test_input_event.h" | 5 #include "ppapi/tests/test_input_event.h" |
6 | 6 |
7 #include "ppapi/c/dev/ppb_testing_dev.h" | 7 #include "ppapi/c/dev/ppb_testing_dev.h" |
8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
9 #include "ppapi/c/ppb_input_event.h" | 9 #include "ppapi/c/ppb_input_event.h" |
10 #include "ppapi/cpp/input_event.h" | 10 #include "ppapi/cpp/input_event.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 case PP_INPUTEVENT_TYPE_KEYDOWN: | 205 case PP_INPUTEVENT_TYPE_KEYDOWN: |
206 case PP_INPUTEVENT_TYPE_KEYUP: | 206 case PP_INPUTEVENT_TYPE_KEYUP: |
207 return | 207 return |
208 keyboard_input_event_interface_->GetKeyCode(received) == | 208 keyboard_input_event_interface_->GetKeyCode(received) == |
209 keyboard_input_event_interface_->GetKeyCode(expected); | 209 keyboard_input_event_interface_->GetKeyCode(expected); |
210 | 210 |
211 case PP_INPUTEVENT_TYPE_CHAR: | 211 case PP_INPUTEVENT_TYPE_CHAR: |
212 return | 212 return |
213 keyboard_input_event_interface_->GetKeyCode(received) == | 213 keyboard_input_event_interface_->GetKeyCode(received) == |
214 keyboard_input_event_interface_->GetKeyCode(expected) && | 214 keyboard_input_event_interface_->GetKeyCode(expected) && |
215 pp::Var(pp::Var::PassRef(), | 215 pp::Var(pp::PASS_REF, |
216 keyboard_input_event_interface_->GetCharacterText(received)) == | 216 keyboard_input_event_interface_->GetCharacterText(received)) == |
217 pp::Var(pp::Var::PassRef(), | 217 pp::Var(pp::PASS_REF, |
218 keyboard_input_event_interface_->GetCharacterText(expected)); | 218 keyboard_input_event_interface_->GetCharacterText(expected)); |
219 | 219 |
220 default: | 220 default: |
221 break; | 221 break; |
222 } | 222 } |
223 | 223 |
224 return false; | 224 return false; |
225 } | 225 } |
226 | 226 |
227 bool TestInputEvent::HandleInputEvent(const pp::InputEvent& input_event) { | 227 bool TestInputEvent::HandleInputEvent(const pp::InputEvent& input_event) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 SimulateInputEvent(CreateWheelEvent())); | 278 SimulateInputEvent(CreateWheelEvent())); |
279 ASSERT_FALSE( | 279 ASSERT_FALSE( |
280 SimulateInputEvent(CreateKeyEvent(PP_INPUTEVENT_TYPE_KEYDOWN, | 280 SimulateInputEvent(CreateKeyEvent(PP_INPUTEVENT_TYPE_KEYDOWN, |
281 kSpaceChar))); | 281 kSpaceChar))); |
282 ASSERT_FALSE( | 282 ASSERT_FALSE( |
283 SimulateInputEvent(CreateCharEvent(kSpaceString))); | 283 SimulateInputEvent(CreateCharEvent(kSpaceString))); |
284 | 284 |
285 PASS(); | 285 PASS(); |
286 } | 286 } |
287 | 287 |
OLD | NEW |