Skip to content

Commit 06454d1

Browse files
committed
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 855b0c8) Refs 2c7e9c9
1 parent c7d458f commit 06454d1

File tree

1 file changed

+37
-29
lines changed

1 file changed

+37
-29
lines changed

test/data/testinit.js

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -270,41 +270,49 @@ this.iframeCallback = undefined;
270270
QUnit.config.autostart = false;
271271
this.loadTests = function() {
272272
var loadSwarm,
273-
url = window.location.search;
273+
url = window.location.search,
274+
basicTests = url.substring( 1 ).split( "&" ).indexOf( "module=basic" ) > -1;
274275

275276
url = decodeURIComponent( url.slice( url.indexOf( "swarmURL=" ) + "swarmURL=".length ) );
276277
loadSwarm = url && url.indexOf( "http" ) === 0;
277278

278279
// Get testSubproject from testrunner first
279280
require( [ "data/testrunner.js" ], function() {
280-
var tests = [
281-
// A special module with basic tests, meant for
282-
// not fully supported environments like Android 2.3,
283-
// jsdom or PhantomJS. We run it everywhere, though,
284-
// to make sure tests are not broken.
285-
"unit/basic.js",
286-
287-
"unit/core.js",
288-
"unit/callbacks.js",
289-
"unit/deferred.js",
290-
"unit/support.js",
291-
"unit/data.js",
292-
"unit/queue.js",
293-
"unit/attributes.js",
294-
"unit/event.js",
295-
"unit/selector.js",
296-
"unit/traversing.js",
297-
"unit/manipulation.js",
298-
"unit/wrap.js",
299-
"unit/css.js",
300-
"unit/serialize.js",
301-
"unit/ajax.js",
302-
"unit/effects.js",
303-
"unit/offset.js",
304-
"unit/dimensions.js",
305-
"unit/animation.js",
306-
"unit/tween.js"
307-
];
281+
var tests = []
282+
.concat( [
283+
284+
// A special module with basic tests, meant for
285+
// not fully supported environments like Android 2.3,
286+
// jsdom or PhantomJS. We run it everywhere, though,
287+
// to make sure tests are not broken.
288+
//
289+
// Support: Android 2.3 only
290+
// When loading basic tests don't load any others to not
291+
// overload Android 2.3.
292+
"unit/basic.js"
293+
] )
294+
.concat( basicTests ? [] : [
295+
"unit/core.js",
296+
"unit/callbacks.js",
297+
"unit/deferred.js",
298+
"unit/support.js",
299+
"unit/data.js",
300+
"unit/queue.js",
301+
"unit/attributes.js",
302+
"unit/event.js",
303+
"unit/selector.js",
304+
"unit/traversing.js",
305+
"unit/manipulation.js",
306+
"unit/wrap.js",
307+
"unit/css.js",
308+
"unit/serialize.js",
309+
"unit/ajax.js",
310+
"unit/effects.js",
311+
"unit/offset.js",
312+
"unit/dimensions.js",
313+
"unit/animation.js",
314+
"unit/tween.js"
315+
] );
308316

309317
// Ensure load order (to preserve test numbers)
310318
( function loadDep() {

0 commit comments

Comments
 (0)