/* * mobile support unit tests */ (function( $ ) { $.testHelper = { asyncLoad: function( opts ) { var baseUrl = opts.baseUrl || "../../../js"; // stop qunit from running the tests until everything is in the page QUnit.config.autostart = false; // set the baseUrl to the js dir or the default require({ baseUrl: baseUrl }); // require the libs required to pass the test suite require( opts.libs, function() { // init the mobile library require( ["jquery.mobile.init"], function() { // reset the base dir to the current directory for including the test libs require({ baseUrl: location.pathname }); // after everything is inplace start the test suite require( opts.testLibs, QUnit.start); }); }); }, excludeFileProtocol: function(callback){ var message = "Tests require script reload and cannot be run via file: protocol"; if (location.protocol == "file:") { test(message, function(){ ok(false, message); }); } else { callback(); } }, // TODO prevent test suite loads when the browser doesn't support push state // and push-state false is defined. setPushStateFor: function( libs ) { if( $.support.pushState && location.search.indexOf( "push-state" ) >= 0 ) { $.support.pushState = false; } $.each(libs, function(i, l) { $( "