mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-10 01:11:02 +00:00
AMDized
This commit is contained in:
parent
3f05a5e12c
commit
c58022c8ff
2 changed files with 42 additions and 24 deletions
|
|
@ -6,16 +6,22 @@
|
|||
<title>jQuery Mobile Support Test Suite</title>
|
||||
|
||||
<script src="../../../js/jquery.js"></script>
|
||||
<script src="../../../tests/jquery.testHelper.js"></script>
|
||||
<script src="../../../js/jquery.ui.widget.js"></script>
|
||||
<script src="../../../js/jquery.mobile.widget.js"></script>
|
||||
<script src="../../../js/jquery.mobile.media.js"></script>
|
||||
<script src="../../../js/jquery.mobile.support.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="../../../external/qunit.css"/>
|
||||
<script src="../../../external/qunit.js"></script>
|
||||
<script src="../../../tests/jquery.testHelper.js"></script>
|
||||
<script src="../../../external/require.js"></script>
|
||||
<script>
|
||||
$.testHelper.asyncLoad([
|
||||
[
|
||||
"jquery.mobile.support"
|
||||
],
|
||||
[
|
||||
"support_core.js"
|
||||
]
|
||||
]);
|
||||
</script>
|
||||
|
||||
<script src="support_core.js"></script>
|
||||
<link rel="stylesheet" href="../../../css/themes/default/"/>
|
||||
<link rel="stylesheet" href="../../../external/qunit.css"/>
|
||||
|
||||
<script src="../swarminject.js"></script>
|
||||
</head>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
|
||||
$.testHelper.excludeFileProtocol(function(){
|
||||
var prependToFn = $.fn.prependTo,
|
||||
libName = "jquery.mobile.support.js";
|
||||
libName = "jquery.mobile.support.js",
|
||||
cnt = 0;
|
||||
|
||||
module(libName, {
|
||||
teardown: function(){
|
||||
|
|
@ -15,7 +16,7 @@ $.testHelper.excludeFileProtocol(function(){
|
|||
|
||||
// NOTE following two tests have debatable value as they only
|
||||
// prevent property name changes and improper attribute checks
|
||||
test( "detects functionality from basic affirmative properties and attributes", function(){
|
||||
asyncTest( "detects functionality from basic affirmative properties and attributes", function(){
|
||||
// TODO expose properties for less brittle tests
|
||||
$.extend(window, {
|
||||
WebKitTransitionEvent: true,
|
||||
|
|
@ -30,23 +31,30 @@ $.testHelper.excludeFileProtocol(function(){
|
|||
|
||||
$.mobile.media = function(){ return true; };
|
||||
|
||||
$.testHelper.reloadLib(libName);
|
||||
require( {context: "test"+(++cnt), baseUrl: "../../../js"} )(["jquery.mobile.support"],
|
||||
function() {
|
||||
ok($.support.orientation);
|
||||
ok($.support.touch);
|
||||
ok($.support.cssTransitions);
|
||||
ok($.support.pushState);
|
||||
ok($.support.mediaquery);
|
||||
start();
|
||||
}
|
||||
);
|
||||
|
||||
ok($.support.orientation);
|
||||
ok($.support.touch);
|
||||
ok($.support.cssTransitions);
|
||||
ok($.support.pushState);
|
||||
ok($.support.mediaquery);
|
||||
});
|
||||
|
||||
test( "detects functionality from basic negative properties and attributes (where possible)", function(){
|
||||
asyncTest( "detects functionality from basic negative properties and attributes (where possible)", function(){
|
||||
delete window["orientation"];
|
||||
delete document["ontouchend"];
|
||||
|
||||
$.testHelper.reloadLib(libName);
|
||||
|
||||
ok(!$.support.orientation);
|
||||
ok(!$.support.touch);
|
||||
require( {context: "test"+(++cnt), baseUrl: "../../../js"} )(["jquery.mobile.support"],
|
||||
function() {
|
||||
ok(!$.support.orientation);
|
||||
ok(!$.support.touch);
|
||||
start();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// NOTE mocks prependTo to simulate base href updates or lack thereof
|
||||
|
|
@ -67,10 +75,14 @@ $.testHelper.excludeFileProtocol(function(){
|
|||
ok($.support.dynamicBaseTag);
|
||||
});
|
||||
|
||||
test( "detects no dynamic base tag when new base element added and base href unchanged", function(){
|
||||
asyncTest( "detects no dynamic base tag when new base element added and base href unchanged", function(){
|
||||
mockBaseCheck('testurl');
|
||||
$.testHelper.reloadLib(libName);
|
||||
ok(!$.support.dynamicBaseTag);
|
||||
require( {context: "test"+(++cnt), baseUrl: "../../../js"} )(["jquery.mobile.support"],
|
||||
function() {
|
||||
ok(!$.support.dynamicBaseTag);
|
||||
start();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
test( "jQM's IE browser check properly detects IE versions", function(){
|
||||
|
|
|
|||
Loading…
Reference in a new issue