test(input): Update input test for pointer events

This commit is contained in:
Adam Bradley
2014-05-12 15:03:39 -05:00
parent 057e02e420
commit addf75a011

View File

@@ -1,3 +1,4 @@
<!DOCTYPE html>
<html ng-app="navTest">
<head>
<meta charset="utf-8">
@@ -219,31 +220,27 @@
var msgs = [];
var timerId;
console.debug2 = function() {
var msg = [];
for (var i = 0, j = arguments.length; i < j; i++){
msg.push(arguments[i]);
}
msg.push(getTime());
msgs.push(msg.join(', '));
clearTimeout(timerId);
timerId = setTimeout(function(){
document.getElementById('view').style.display = 'none';
document.writeln(msgs.join('<br>'));
console.debug = function(){};
}, 2000);
};
document.addEventListener('touchstart', function(e){
console.debug('touchstart');
console.log('touchstart');
});
document.addEventListener('touchstart', function(e){
console.debug('touchend');
console.log('touchend');
});
document.addEventListener('mousedown', function(e){
console.log('mousedown');
});
document.addEventListener('mouseup', function(e){
console.log('mouseup');
});
document.addEventListener('MSPointerDown', function(e){
console.log('MSPointerDown');
});
document.addEventListener('MSPointerUp', function(e){
console.log('MSPointerUp');
});
document.addEventListener('click', function(event){
console.debug('click', 'clientX: ' + event.clientX, 'clientY: ' + event.clientY);
console.log('click', 'clientX: ' + event.clientX, 'clientY: ' + event.clientY);
});
function getTime() {
@@ -281,14 +278,24 @@
var msgs = [];
var index = 0;
var timeId;
var consoleDebug = console.debug;
var consoleDebug = console.log;
var consoleError = console.log;
function getTime() {
var d = new Date();
return d.getMilliseconds();
}
console.debug = function() {
console.error = function() {
consoleError.apply(this, arguments);
var args = ['ERROR!'];
for (var i = 0, j = arguments.length; i < j; i++){
args.push(arguments[i]);
}
console.log.apply(this, args);
};
console.log = function() {
index++;
var msg = [];
msg.push(index);