Tests: Don't load non-basic tests when basic module is selected

When loading basic tests don't load any others to not overload Android 2.3.
The drawback is that most tests are not selectable in the module dropdown
when the basic module is seelcted.

(cherry-picked from 855b0c8c28)

Refs 2c7e9c9349
This commit is contained in:
Michał Gołębiowski 2015-09-08 18:36:02 +02:00
parent c7d458fb9e
commit 06454d118f

View File

@ -270,41 +270,49 @@ this.iframeCallback = undefined;
QUnit.config.autostart = false; QUnit.config.autostart = false;
this.loadTests = function() { this.loadTests = function() {
var loadSwarm, var loadSwarm,
url = window.location.search; url = window.location.search,
basicTests = url.substring( 1 ).split( "&" ).indexOf( "module=basic" ) > -1;
url = decodeURIComponent( url.slice( url.indexOf( "swarmURL=" ) + "swarmURL=".length ) ); url = decodeURIComponent( url.slice( url.indexOf( "swarmURL=" ) + "swarmURL=".length ) );
loadSwarm = url && url.indexOf( "http" ) === 0; loadSwarm = url && url.indexOf( "http" ) === 0;
// Get testSubproject from testrunner first // Get testSubproject from testrunner first
require( [ "data/testrunner.js" ], function() { require( [ "data/testrunner.js" ], function() {
var tests = [ var tests = []
// A special module with basic tests, meant for .concat( [
// not fully supported environments like Android 2.3,
// jsdom or PhantomJS. We run it everywhere, though,
// to make sure tests are not broken.
"unit/basic.js",
"unit/core.js", // A special module with basic tests, meant for
"unit/callbacks.js", // not fully supported environments like Android 2.3,
"unit/deferred.js", // jsdom or PhantomJS. We run it everywhere, though,
"unit/support.js", // to make sure tests are not broken.
"unit/data.js", //
"unit/queue.js", // Support: Android 2.3 only
"unit/attributes.js", // When loading basic tests don't load any others to not
"unit/event.js", // overload Android 2.3.
"unit/selector.js", "unit/basic.js"
"unit/traversing.js", ] )
"unit/manipulation.js", .concat( basicTests ? [] : [
"unit/wrap.js", "unit/core.js",
"unit/css.js", "unit/callbacks.js",
"unit/serialize.js", "unit/deferred.js",
"unit/ajax.js", "unit/support.js",
"unit/effects.js", "unit/data.js",
"unit/offset.js", "unit/queue.js",
"unit/dimensions.js", "unit/attributes.js",
"unit/animation.js", "unit/event.js",
"unit/tween.js" "unit/selector.js",
]; "unit/traversing.js",
"unit/manipulation.js",
"unit/wrap.js",
"unit/css.js",
"unit/serialize.js",
"unit/ajax.js",
"unit/effects.js",
"unit/offset.js",
"unit/dimensions.js",
"unit/animation.js",
"unit/tween.js"
] );
// Ensure load order (to preserve test numbers) // Ensure load order (to preserve test numbers)
( function loadDep() { ( function loadDep() {