2012-01-03 18:33:26 +00:00
|
|
|
<?php
|
|
|
|
|
|
2014-02-05 05:17:48 +00:00
|
|
|
/* Modules registered when $wgEnableJavaScriptTest is true */
|
|
|
|
|
|
2016-02-17 09:09:32 +00:00
|
|
|
return [
|
2012-01-03 18:33:26 +00:00
|
|
|
|
2014-02-05 05:17:48 +00:00
|
|
|
/* Utilities */
|
|
|
|
|
|
2016-02-17 09:09:32 +00:00
|
|
|
'test.sinonjs' => [
|
|
|
|
|
'scripts' => [
|
2015-07-07 09:28:16 +00:00
|
|
|
'resources/lib/sinonjs/sinon-1.15.4.js',
|
2014-03-06 02:33:59 +00:00
|
|
|
// We want tests to work in IE, but can't include this as it
|
|
|
|
|
// will break the placeholders in Sinon because the hack it uses
|
|
|
|
|
// to hijack IE globals relies on running in the global scope
|
|
|
|
|
// and in ResourceLoader this won't be running in the global scope.
|
|
|
|
|
// Including it results (among other things) in sandboxed timers
|
|
|
|
|
// being broken due to Date inheritance being undefined.
|
2015-07-07 09:28:16 +00:00
|
|
|
// 'resources/lib/sinonjs/sinon-ie-1.15.4.js',
|
2016-02-17 09:09:32 +00:00
|
|
|
],
|
|
|
|
|
'targets' => [ 'desktop', 'mobile' ],
|
|
|
|
|
],
|
qunit: Add SinonJS utility
To be used in mediawiki.api tests and elsewhere.
For now they are opt-in and disabled by default,
individual tests can enable fake timers, servers and/or
xhrs by calling this.sandbox to access the dedicated
sinon sandbox for that test.
Clock example:
QUnit.test( 'example', function ( assert ) {
var clock = this.sandbox.useFakeTimers();
setTimeout( function () {
assert.ok( true, 'test' );
} );
clock.tick(1);
} );
Server example:
QUnit.test( 'example', function ( assert ) {
this.server = this.sandbox.useFakeServer();
new mw.Api().getToken( 'foo' ).done( function ( token ) {
assert.equal( token, '0123abc', 'Token' );
} );
// assert.equal( this.server.requests.length, 1, 'Requests' );
this.server.respond( function ( request ) {
request.respond( 200, { 'Content-Type': 'application/json' },
'{ "tokens": { "testactiontoken": "0123abc" } }'
);
} );
} );
Change-Id: I789fb71903f26dbbfe781f010dc5cd3756759943
2014-02-05 05:18:28 +00:00
|
|
|
|
2016-02-17 09:09:32 +00:00
|
|
|
'test.mediawiki.qunit.testrunner' => [
|
|
|
|
|
'scripts' => [
|
2014-02-05 05:17:48 +00:00
|
|
|
'tests/qunit/data/testrunner.js',
|
2016-02-17 09:09:32 +00:00
|
|
|
],
|
|
|
|
|
'dependencies' => [
|
2014-12-02 21:48:21 +00:00
|
|
|
// Test runner configures QUnit but can't have it as dependency,
|
|
|
|
|
// see SpecialJavaScriptTest::viewQUnit.
|
2014-02-05 05:17:48 +00:00
|
|
|
'jquery.getAttrs',
|
|
|
|
|
'mediawiki.page.ready',
|
|
|
|
|
'mediawiki.page.startup',
|
qunit: Add SinonJS utility
To be used in mediawiki.api tests and elsewhere.
For now they are opt-in and disabled by default,
individual tests can enable fake timers, servers and/or
xhrs by calling this.sandbox to access the dedicated
sinon sandbox for that test.
Clock example:
QUnit.test( 'example', function ( assert ) {
var clock = this.sandbox.useFakeTimers();
setTimeout( function () {
assert.ok( true, 'test' );
} );
clock.tick(1);
} );
Server example:
QUnit.test( 'example', function ( assert ) {
this.server = this.sandbox.useFakeServer();
new mw.Api().getToken( 'foo' ).done( function ( token ) {
assert.equal( token, '0123abc', 'Token' );
} );
// assert.equal( this.server.requests.length, 1, 'Requests' );
this.server.respond( function ( request ) {
request.respond( 200, { 'Content-Type': 'application/json' },
'{ "tokens": { "testactiontoken": "0123abc" } }'
);
} );
} );
Change-Id: I789fb71903f26dbbfe781f010dc5cd3756759943
2014-02-05 05:18:28 +00:00
|
|
|
'test.sinonjs',
|
2015-07-13 18:02:49 +00:00
|
|
|
'dom-level2-shim',
|
2016-02-17 09:09:32 +00:00
|
|
|
],
|
2014-02-05 05:17:48 +00:00
|
|
|
'position' => 'top',
|
2016-02-17 09:09:32 +00:00
|
|
|
'targets' => [ 'desktop', 'mobile' ],
|
|
|
|
|
],
|
2014-02-05 05:17:48 +00:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Test suites for MediaWiki core modules
|
|
|
|
|
These must have a dependency on test.mediawiki.qunit.testrunner!
|
|
|
|
|
*/
|
2012-01-03 18:33:26 +00:00
|
|
|
|
2016-02-17 09:09:32 +00:00
|
|
|
'test.mediawiki.qunit.suites' => [
|
|
|
|
|
'scripts' => [
|
2013-04-05 00:35:37 +00:00
|
|
|
'tests/qunit/suites/resources/startup.test.js',
|
2014-04-22 12:16:45 +00:00
|
|
|
'tests/qunit/suites/resources/jquery/jquery.accessKeyLabel.test.js',
|
2012-01-03 18:33:26 +00:00
|
|
|
'tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js',
|
|
|
|
|
'tests/qunit/suites/resources/jquery/jquery.byteLength.test.js',
|
|
|
|
|
'tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js',
|
2014-02-27 00:26:50 +00:00
|
|
|
'tests/qunit/suites/resources/jquery/jquery.color.test.js',
|
2012-01-03 18:33:26 +00:00
|
|
|
'tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js',
|
|
|
|
|
'tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js',
|
Initial stab at responsive images for screen densities.
* adds $wgResponsiveImages setting, defaulting to true, to enable the feature
* adds 'srcset' attribute with 1.5x and 2x URLs to image links and image thumbs
* adds jquery.hidpi plugin to check pixel density and implement partial 'srcset' polyfill
** $.devicePixelRatio() returns window.devicePixelRatio, with compat fallback for IE 10
** $().hidpi() performs a 'srcset' polyfill for browsers with no native 'srcset' support
* adds mediawiki.hidpi RL script to trigger hidpi loads after main images load
Note that this is a work in progress. There will be places where this doesn't yet work which output their imgs differently. If moving from a low to high-DPI screen on a MacBook Pro Retina display, you won't see images load until you reload.
Confirmed basic images and thumbs in wikitext appear to work in Safari 6, Chrome 21, Firefox 18 nightly on MacBook Pro Retina display, and IE 10 in Windows 8 at 150% zoom, 200% zoom, and 140% and 180%-ratio Metro tablet sizes.
Internally this is still a bit of a hack; Linker::makeImageLink and Linker::makeThumbLink explicitly ask for 1.5x and 2x scaled versions and insert their URLs, if different, into the original thumbnail object which (in default handler) outputs the srcset. This means that a number of places that handle images differently won't see the higher-resolution versions, such as <gallery> and the large thumbnail on the File: description page.
At some point we may wish to redo some of how the MediaHandler stuff works so that requesting a single thumbnail automatically produces the extra sizes in all circumstances. We might also consider outputting a 'srcset' or multiple src sizes in 'imageinfo' API requests, which would make ApiForeignRepo/InstantCommons more efficient. (Currently it has to make three requests for each image to get the three sizes.)
Change-Id: Id80ebd07a1a9f401a2c2bfeb21aae987e5aa863b
2012-09-18 07:18:50 +00:00
|
|
|
'tests/qunit/suites/resources/jquery/jquery.hidpi.test.js',
|
2012-01-03 18:33:26 +00:00
|
|
|
'tests/qunit/suites/resources/jquery/jquery.highlightText.test.js',
|
|
|
|
|
'tests/qunit/suites/resources/jquery/jquery.localize.test.js',
|
2013-03-25 19:16:07 +00:00
|
|
|
'tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js',
|
2012-01-03 18:33:26 +00:00
|
|
|
'tests/qunit/suites/resources/jquery/jquery.mwExtension.test.js',
|
2013-11-28 22:50:46 +00:00
|
|
|
'tests/qunit/suites/resources/jquery/jquery.placeholder.test.js',
|
2012-01-03 18:33:26 +00:00
|
|
|
'tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js',
|
|
|
|
|
'tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js',
|
2015-01-30 20:21:48 +00:00
|
|
|
'tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js',
|
2012-01-03 18:33:26 +00:00
|
|
|
'tests/qunit/suites/resources/jquery/jquery.textSelection.test.js',
|
2012-09-12 07:57:31 +00:00
|
|
|
'tests/qunit/data/mediawiki.jqueryMsg.data.js',
|
2015-10-21 01:52:52 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.requestIdleCallback.test.js',
|
2015-01-29 01:21:01 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.errorLogger.test.js',
|
2012-06-07 20:45:53 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js',
|
2012-01-03 18:33:26 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.jscompat.test.js',
|
2015-03-31 03:28:11 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.messagePoster.factory.test.js',
|
2015-06-20 05:46:24 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.RegExp.test.js',
|
2015-08-11 18:16:21 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.storage.test.js',
|
2015-03-27 23:54:45 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.template.test.js',
|
2015-04-25 00:12:46 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.template.mustache.test.js',
|
2012-01-03 18:33:26 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.test.js',
|
2015-10-31 15:47:00 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.html.test.js',
|
2012-01-04 19:11:45 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js',
|
2014-01-24 08:36:20 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.toc.test.js',
|
2015-03-27 23:54:45 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.track.test.js',
|
2012-04-07 16:52:02 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js',
|
2012-01-03 18:33:26 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js',
|
|
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js',
|
2016-01-28 17:49:38 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.viewport.test.js',
|
2012-06-07 20:45:53 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js',
|
2014-05-03 19:34:23 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki.api/mediawiki.api.category.test.js',
|
2015-11-07 22:56:06 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki.api/mediawiki.api.messages.test.js',
|
2014-09-14 22:16:11 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki.api/mediawiki.api.options.test.js',
|
2012-06-07 20:45:53 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js',
|
2015-06-24 19:00:19 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki.api/mediawiki.api.upload.test.js',
|
2014-03-10 19:14:30 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki.api/mediawiki.api.watch.test.js',
|
2015-08-14 23:17:49 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki.api/mediawiki.ForeignApi.test.js',
|
2012-01-03 18:33:26 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki.special/mediawiki.special.recentchanges.test.js',
|
2012-06-04 09:40:16 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js',
|
2012-08-22 13:15:44 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.cldr.test.js',
|
2014-03-25 15:18:09 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.cookie.test.js',
|
2015-08-12 19:53:19 +00:00
|
|
|
'tests/qunit/suites/resources/mediawiki/mediawiki.experiments.test.js',
|
2016-02-17 09:09:32 +00:00
|
|
|
],
|
|
|
|
|
'dependencies' => [
|
2014-04-22 12:16:45 +00:00
|
|
|
'jquery.accessKeyLabel',
|
2012-01-03 18:33:26 +00:00
|
|
|
'jquery.autoEllipsis',
|
|
|
|
|
'jquery.byteLength',
|
|
|
|
|
'jquery.byteLimit',
|
2014-02-27 00:26:50 +00:00
|
|
|
'jquery.color',
|
2012-01-03 18:33:26 +00:00
|
|
|
'jquery.colorUtil',
|
|
|
|
|
'jquery.getAttrs',
|
Initial stab at responsive images for screen densities.
* adds $wgResponsiveImages setting, defaulting to true, to enable the feature
* adds 'srcset' attribute with 1.5x and 2x URLs to image links and image thumbs
* adds jquery.hidpi plugin to check pixel density and implement partial 'srcset' polyfill
** $.devicePixelRatio() returns window.devicePixelRatio, with compat fallback for IE 10
** $().hidpi() performs a 'srcset' polyfill for browsers with no native 'srcset' support
* adds mediawiki.hidpi RL script to trigger hidpi loads after main images load
Note that this is a work in progress. There will be places where this doesn't yet work which output their imgs differently. If moving from a low to high-DPI screen on a MacBook Pro Retina display, you won't see images load until you reload.
Confirmed basic images and thumbs in wikitext appear to work in Safari 6, Chrome 21, Firefox 18 nightly on MacBook Pro Retina display, and IE 10 in Windows 8 at 150% zoom, 200% zoom, and 140% and 180%-ratio Metro tablet sizes.
Internally this is still a bit of a hack; Linker::makeImageLink and Linker::makeThumbLink explicitly ask for 1.5x and 2x scaled versions and insert their URLs, if different, into the original thumbnail object which (in default handler) outputs the srcset. This means that a number of places that handle images differently won't see the higher-resolution versions, such as <gallery> and the large thumbnail on the File: description page.
At some point we may wish to redo some of how the MediaHandler stuff works so that requesting a single thumbnail automatically produces the extra sizes in all circumstances. We might also consider outputting a 'srcset' or multiple src sizes in 'imageinfo' API requests, which would make ApiForeignRepo/InstantCommons more efficient. (Currently it has to make three requests for each image to get the three sizes.)
Change-Id: Id80ebd07a1a9f401a2c2bfeb21aae987e5aa863b
2012-09-18 07:18:50 +00:00
|
|
|
'jquery.hidpi',
|
2012-01-03 18:33:26 +00:00
|
|
|
'jquery.highlightText',
|
|
|
|
|
'jquery.localize',
|
2013-03-25 19:16:07 +00:00
|
|
|
'jquery.makeCollapsible',
|
2012-01-03 18:33:26 +00:00
|
|
|
'jquery.mwExtension',
|
2013-11-28 22:50:46 +00:00
|
|
|
'jquery.placeholder',
|
2012-01-03 18:33:26 +00:00
|
|
|
'jquery.tabIndex',
|
|
|
|
|
'jquery.tablesorter',
|
|
|
|
|
'jquery.textSelection',
|
2012-06-07 20:45:53 +00:00
|
|
|
'mediawiki.api',
|
2014-05-03 19:34:23 +00:00
|
|
|
'mediawiki.api.category',
|
2015-11-07 22:56:06 +00:00
|
|
|
'mediawiki.api.messages',
|
2014-09-14 22:16:11 +00:00
|
|
|
'mediawiki.api.options',
|
2012-06-07 20:45:53 +00:00
|
|
|
'mediawiki.api.parse',
|
2015-06-24 19:00:19 +00:00
|
|
|
'mediawiki.api.upload',
|
2014-03-10 19:14:30 +00:00
|
|
|
'mediawiki.api.watch',
|
2015-08-14 23:17:49 +00:00
|
|
|
'mediawiki.ForeignApi.core',
|
2012-06-07 20:45:53 +00:00
|
|
|
'mediawiki.jqueryMsg',
|
2015-03-31 03:28:11 +00:00
|
|
|
'mediawiki.messagePoster',
|
2015-06-20 05:46:24 +00:00
|
|
|
'mediawiki.RegExp',
|
2015-08-11 18:16:21 +00:00
|
|
|
'mediawiki.storage',
|
2012-01-03 18:33:26 +00:00
|
|
|
'mediawiki.Title',
|
2014-04-14 20:16:08 +00:00
|
|
|
'mediawiki.toc',
|
2012-04-07 16:52:02 +00:00
|
|
|
'mediawiki.Uri',
|
2012-01-03 18:33:26 +00:00
|
|
|
'mediawiki.user',
|
2015-04-25 00:12:46 +00:00
|
|
|
'mediawiki.template.mustache',
|
2014-10-10 00:07:14 +00:00
|
|
|
'mediawiki.template',
|
2012-01-03 18:33:26 +00:00
|
|
|
'mediawiki.util',
|
2016-01-28 17:49:38 +00:00
|
|
|
'mediawiki.viewport',
|
2012-01-03 18:33:26 +00:00
|
|
|
'mediawiki.special.recentchanges',
|
2012-06-07 20:45:53 +00:00
|
|
|
'mediawiki.language',
|
2012-08-22 13:15:44 +00:00
|
|
|
'mediawiki.cldr',
|
2014-03-25 15:18:09 +00:00
|
|
|
'mediawiki.cookie',
|
2015-08-12 19:53:19 +00:00
|
|
|
'mediawiki.experiments',
|
2014-02-05 05:17:48 +00:00
|
|
|
'test.mediawiki.qunit.testrunner',
|
2016-02-17 09:09:32 +00:00
|
|
|
],
|
|
|
|
|
]
|
|
|
|
|
];
|