2017-05-11 07:06:41 +00:00
|
|
|
test(function () {
|
|
|
|
var page = require('webpage').create();
|
|
|
|
|
|
|
|
page.evaluate(function() {
|
|
|
|
window.addEventListener('mousemove', function(event) {
|
|
|
|
window.loggedEvent = window.loggedEvent || [];
|
2017-07-22 03:29:31 +00:00
|
|
|
window.loggedEvent.push({clientX: event.clientX, clientY: event.clientY});
|
2017-05-11 07:06:41 +00:00
|
|
|
}, false);
|
|
|
|
});
|
|
|
|
|
|
|
|
page.sendEvent('mousemove', 14, 3);
|
|
|
|
var loggedEvent = page.evaluate(function() {
|
|
|
|
return window.loggedEvent;
|
|
|
|
});
|
|
|
|
assert_equals(loggedEvent.length, 1);
|
|
|
|
assert_equals(loggedEvent[0].clientX, 14);
|
|
|
|
assert_equals(loggedEvent[0].clientY, 3);
|
|
|
|
}, "mouse-move events");
|