Skip to content

Commit

Permalink
Added tests for touchEnabled UA entry
Browse files Browse the repository at this point in the history
  • Loading branch information
davglass committed Oct 3, 2012
1 parent de2616f commit c89031d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/yui/tests/unit/assets/ua-tests.js
Expand Up @@ -21,6 +21,30 @@ YUI.add('ua-tests', function(Y) {
}
}));

suite.add(new Y.Test.Case({
name: 'Touch Enabled Tests',
_should: {
ignore: {
'test: ie10 Windows touchEnabled': !Y.UA.ie,
'test: iOS touchEnabled': !Y.UA.ios
}
},
'test: ie10 Windows touchEnabled': function() {
if ('msPointerEnabled' in Y.config.win.navigator) {
Assert.isTrue(Y.UA.touchEnabled);
} else {
Assert.isFalse(Y.UA.touchEnabled);
}
},
'test: iOS touchEnabled': function() {
if ('ontouchstart' in Y.config.win) {
Assert.isTrue(Y.UA.touchEnabled);
} else {
Assert.isFalse(Y.UA.touchEnabled);
}
}
}));

suite.add(new Y.Test.Case({
name: 'IE 10/Windows 8 App',
_should: {
Expand Down

0 comments on commit c89031d

Please sign in to comment.