mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-19 22:00:59 +00:00
orientation support tests for native vs resize
This commit is contained in:
parent
7f51d4fcf5
commit
6f8aada084
1 changed files with 39 additions and 0 deletions
|
|
@ -311,4 +311,43 @@
|
|||
|
||||
$($.event.special.swipe).trigger("touchmove");
|
||||
});
|
||||
|
||||
var nativeSupportTest = function(opts){
|
||||
$.support.orientation = opts.orientationSupport;
|
||||
|
||||
same($.event.special.orientationchange[opts.method](),
|
||||
opts.returnValue);
|
||||
};
|
||||
|
||||
test( "orientation change setup should do nothing when natively supported", function(){
|
||||
nativeSupportTest({
|
||||
method: 'setup',
|
||||
orientationSupport: true,
|
||||
returnValue: false
|
||||
});
|
||||
});
|
||||
|
||||
test( "orientation change setup should bind resize when not supported natively", function(){
|
||||
nativeSupportTest({
|
||||
method: 'setup',
|
||||
orientationSupport: false,
|
||||
returnValue: undefined //NOTE result of bind function call
|
||||
});
|
||||
});
|
||||
|
||||
test( "orientation change teardown should do nothing when natively supported", function(){
|
||||
nativeSupportTest({
|
||||
method: 'teardown',
|
||||
orientationSupport: true,
|
||||
returnValue: false
|
||||
});
|
||||
});
|
||||
|
||||
test( "orientation change teardown should unbind resize when not supported natively", function(){
|
||||
nativeSupportTest({
|
||||
method: 'teardown',
|
||||
orientationSupport: false,
|
||||
returnValue: undefined //NOTE result of unbind function call
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
Loading…
Reference in a new issue