Created
November 8, 2013 23:45
-
-
Save pennyfx/7379441 to your computer and use it in GitHub Desktop.
click eventsssssss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var clickTouch = false; | |
var clickHandler = function(e){ | |
clickTouch = e.touches; | |
} | |
document.addEventListener('mousedown', clickHandler); | |
waitsFor(function(){ | |
return clickTouch !== false; | |
}); | |
var me = document.createEvent('MouseEvent'); | |
me.initMouseEvent('mousedown', true, true, window, {}, 0,0,0,0,false, false, false, false, 0, null); | |
document.dispatchEvent(me); | |
runs(function(){ | |
expect(clickTouch instanceof Array).toEqual(true); | |
}); | |
document.removeEventListener('mousedown', clickHandler); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment