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 function setupTests(tester, plugin) { | 5 function setupTests(tester, plugin) { |
6 ////////////////////////////////////////////////////////////////////////////// | 6 ////////////////////////////////////////////////////////////////////////////// |
7 // Test Helpers | 7 // Test Helpers |
8 ////////////////////////////////////////////////////////////////////////////// | 8 ////////////////////////////////////////////////////////////////////////////// |
9 | 9 |
10 // These are the coordinates of the upper-left corner of the nacl plugin | 10 // These are the coordinates of the upper-left corner of the nacl plugin |
11 // TODO(mball): Avoid hardcoding this location by querying the location | 11 var leftCorner = plugin.offsetLeft; |
12 // of the plugin. | 12 var topCorner = plugin.offsetTop; |
13 var leftCorner = 8, topCorner = 79 | |
14 | 13 |
15 function simulateMouseEvent(eventName) { | 14 function simulateMouseEvent(eventName) { |
16 var event = document.createEvent('MouseEvents'); | 15 var event = document.createEvent('MouseEvents'); |
17 event.initMouseEvent( | 16 event.initMouseEvent( |
18 eventName, | 17 eventName, |
19 true, // bubbles | 18 true, // bubbles |
20 true, // cancelable | 19 true, // cancelable |
21 document.defaultView, | 20 document.defaultView, |
22 1, // one click | 21 1, // one click |
23 0, 0, // Screen coordinate | 22 0, 0, // Screen coordinate |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 addTest( | 79 addTest( |
81 testName, | 80 testName, |
82 'mousedown', | 81 'mousedown', |
83 'PP_INPUTEVENT_TYPE_MOUSEDOWN' + | 82 'PP_INPUTEVENT_TYPE_MOUSEDOWN' + |
84 ':PP_INPUTEVENT_MODIFIER_LEFTBUTTONDOWN' + | 83 ':PP_INPUTEVENT_MODIFIER_LEFTBUTTONDOWN' + |
85 ':PP_INPUTEVENT_MOUSEBUTTON_LEFT' + | 84 ':PP_INPUTEVENT_MOUSEBUTTON_LEFT' + |
86 ':Position=0,0:ClickCount=1', | 85 ':Position=0,0:ClickCount=1', |
87 simulateMouseEvent); | 86 simulateMouseEvent); |
88 }); | 87 }); |
89 } | 88 } |
OLD | NEW |