| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 PPB_WHEEL_INPUT_EVENT_INTERFACE)); | 66 PPB_WHEEL_INPUT_EVENT_INTERFACE)); |
| 67 keyboard_input_event_interface_ = static_cast<const PPB_KeyboardInputEvent*>( | 67 keyboard_input_event_interface_ = static_cast<const PPB_KeyboardInputEvent*>( |
| 68 pp::Module::Get()->GetBrowserInterface( | 68 pp::Module::Get()->GetBrowserInterface( |
| 69 PPB_KEYBOARD_INPUT_EVENT_INTERFACE)); | 69 PPB_KEYBOARD_INPUT_EVENT_INTERFACE)); |
| 70 | 70 |
| 71 bool success = | 71 bool success = |
| 72 input_event_interface_ && | 72 input_event_interface_ && |
| 73 mouse_input_event_interface_ && | 73 mouse_input_event_interface_ && |
| 74 wheel_input_event_interface_ && | 74 wheel_input_event_interface_ && |
| 75 keyboard_input_event_interface_ && | 75 keyboard_input_event_interface_ && |
| 76 InitTestingInterface(); | 76 CheckTestingInterface(); |
| 77 | 77 |
| 78 // Set up a listener for our message that signals that all input events have | 78 // Set up a listener for our message that signals that all input events have |
| 79 // been received. | 79 // been received. |
| 80 std::string js_code; | 80 std::string js_code; |
| 81 // Note the following code is dependent on some features of test_case.html. | 81 // Note the following code is dependent on some features of test_case.html. |
| 82 // E.g., it is assumed that the DOM element where the plugin is embedded has | 82 // E.g., it is assumed that the DOM element where the plugin is embedded has |
| 83 // an id of 'plugin', and there is a function 'IsTestingMessage' that allows | 83 // an id of 'plugin', and there is a function 'IsTestingMessage' that allows |
| 84 // us to ignore the messages that are intended for use by the testing | 84 // us to ignore the messages that are intended for use by the testing |
| 85 // framework itself. | 85 // framework itself. |
| 86 js_code += "var plugin = document.getElementById('plugin');" | 86 js_code += "var plugin = document.getElementById('plugin');" |
| (...skipping 191 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 |