/* * mobile support unit tests */ (function( $ ) { $.testHelper = { // This function takes sets of files to load asynchronously. Each set will be loaded after // the previous set has completed loading. That is, each require and it's dependencies in a // set will be loaded asynchronously, but each set will be run in serial. asyncLoad: function( seq ) { require({ baseUrl: "../../../js" }); function loadSeq( seq, i ){ if( !seq[i] ){ QUnit.start(); return; } require( seq[i], function() { loadSeq(seq, i + 1); }); } // stop qunit from running the tests until everything is in the page QUnit.config.autostart = false; loadSeq( seq, 0 ); }, 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) { $( "