This parameter is a no-op for these tests, as such, nothing was being
tested by specifying it in tests. The behaviour 'test' and 'test.top'
was identical.
Bug: T184257
Change-Id: Ia2bb731f00d4b4175f7b75174aeafaca9412329e
protected $dependencies = [];
protected $group = null;
protected $source = 'local';
protected $dependencies = [];
protected $group = null;
protected $source = 'local';
- protected $position = 'bottom';
protected $script = '';
protected $styles = '';
protected $skipFunction = null;
protected $script = '';
protected $styles = '';
protected $skipFunction = null;
public function getSource() {
return $this->source;
}
public function getSource() {
return $this->source;
}
- public function getPosition() {
- return $this->position;
- }
public function getType() {
return $this->type;
public function getType() {
return $this->type;
protected static function makeSampleModules() {
$modules = [
'test' => [],
protected static function makeSampleModules() {
$modules = [
'test' => [],
- 'test.top' => [ 'position' => 'top' ],
- 'test.private.top' => [ 'group' => 'private', 'position' => 'top' ],
- 'test.private.bottom' => [ 'group' => 'private', 'position' => 'bottom' ],
+ 'test.private' => [ 'group' => 'private' ],
'test.shouldembed.empty' => [ 'shouldEmbed' => true, 'isKnownEmpty' => true ],
'test.shouldembed' => [ 'shouldEmbed' => true ],
'test.shouldembed.empty' => [ 'shouldEmbed' => true, 'isKnownEmpty' => true ],
'test.shouldembed' => [ 'shouldEmbed' => true ],
- 'test.scripts.top' => [ 'position' => 'top' ],
'test.scripts.user' => [ 'group' => 'user' ],
'test.scripts.user.empty' => [ 'group' => 'user', 'isKnownEmpty' => true ],
'test.scripts.raw' => [ 'isRaw' => true ],
'test.scripts.user' => [ 'group' => 'user' ],
'test.scripts.user.empty' => [ 'group' => 'user', 'isKnownEmpty' => true ],
'test.scripts.raw' => [ 'isRaw' => true ],
$client = new ResourceLoaderClientHtml( $context );
$client->setModules( [
'test',
$client = new ResourceLoaderClientHtml( $context );
$client->setModules( [
'test',
- 'test.private.bottom',
- 'test.private.top',
- 'test.top',
'test.shouldembed.empty',
'test.shouldembed',
'test.unregistered',
'test.shouldembed.empty',
'test.shouldembed',
'test.unregistered',
$client->setModuleScripts( [
'test.scripts',
'test.scripts.user.empty',
$client->setModuleScripts( [
'test.scripts',
'test.scripts.user.empty',
'test.scripts.shouldembed',
'test.unregistered.scripts',
] );
$expected = [
'states' => [
'test.scripts.shouldembed',
'test.unregistered.scripts',
] );
$expected = [
'states' => [
- 'test.private.top' => 'loading',
- 'test.private.bottom' => 'loading',
+ 'test.private' => 'loading',
'test.shouldembed.empty' => 'ready',
'test.shouldembed' => 'loading',
'test.styles.pure' => 'ready',
'test.shouldembed.empty' => 'ready',
'test.shouldembed' => 'loading',
'test.styles.pure' => 'ready',
'test.styles.private' => 'ready',
'test.styles.shouldembed' => 'ready',
'test.scripts' => 'loading',
'test.styles.private' => 'ready',
'test.styles.shouldembed' => 'ready',
'test.scripts' => 'loading',
- 'test.scripts.top' => 'loading',
'test.scripts.user.empty' => 'ready',
'test.scripts.shouldembed' => 'loading',
],
'general' => [
'test',
'test.scripts.user.empty' => 'ready',
'test.scripts.shouldembed' => 'loading',
],
'general' => [
'test',
],
'styles' => [
'test.styles.pure',
],
'scripts' => [
'test.scripts',
],
'styles' => [
'test.styles.pure',
],
'scripts' => [
'test.scripts',
'test.scripts.shouldembed',
],
'embed' => [
'styles' => [ 'test.styles.private', 'test.styles.shouldembed' ],
'general' => [
'test.scripts.shouldembed',
],
'embed' => [
'styles' => [ 'test.styles.private', 'test.styles.shouldembed' ],
'general' => [
- 'test.private.bottom',
- 'test.private.top',
'test.shouldembed',
],
],
'test.shouldembed',
],
],
$client = new ResourceLoaderClientHtml( $context );
$client->setConfig( [ 'key' => 'value' ] );
$client->setModules( [
$client = new ResourceLoaderClientHtml( $context );
$client->setConfig( [ 'key' => 'value' ] );
$client->setModules( [
- 'test.top',
- 'test.private.top',
+ 'test',
+ 'test.private',
] );
$client->setModuleStyles( [
'test.styles.pure',
'test.styles.private',
] );
$client->setModuleScripts( [
] );
$client->setModuleStyles( [
'test.styles.pure',
'test.styles.private',
] );
$client->setModuleScripts( [
] );
$client->setExemptStates( [
'test.exempt' => 'ready',
] );
$client->setExemptStates( [
'test.exempt' => 'ready',
$expected = '<script>document.documentElement.className = document.documentElement.className.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );</script>' . "\n"
. '<script>(window.RLQ=window.RLQ||[]).push(function(){'
. 'mw.config.set({"key":"value"});'
$expected = '<script>document.documentElement.className = document.documentElement.className.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );</script>' . "\n"
. '<script>(window.RLQ=window.RLQ||[]).push(function(){'
. 'mw.config.set({"key":"value"});'
- . 'mw.loader.state({"test.exempt":"ready","test.private.top":"loading","test.styles.pure":"ready","test.styles.private":"ready","test.scripts.top":"loading"});'
- . 'mw.loader.implement("test.private.top@{blankVer}",function($,jQuery,require,module){},{"css":[]});'
- . 'mw.loader.load(["test.top"]);'
- . 'mw.loader.load("/w/load.php?debug=false\u0026lang=nl\u0026modules=test.scripts.top\u0026only=scripts\u0026skin=fallback");'
+ . 'mw.loader.state({"test.exempt":"ready","test.private":"loading","test.styles.pure":"ready","test.styles.private":"ready","test.scripts":"loading"});'
+ . 'mw.loader.implement("test.private@{blankVer}",function($,jQuery,require,module){},{"css":[]});'
+ . 'mw.loader.load(["test"]);'
+ . 'mw.loader.load("/w/load.php?debug=false\u0026lang=nl\u0026modules=test.scripts\u0026only=scripts\u0026skin=fallback");'
. '});</script>' . "\n"
. '<link rel="stylesheet" href="/w/load.php?debug=false&lang=nl&modules=test.styles.pure&only=styles&skin=fallback"/>' . "\n"
. '<style>.private{}</style>' . "\n"
. '});</script>' . "\n"
. '<link rel="stylesheet" href="/w/load.php?debug=false&lang=nl&modules=test.styles.pure&only=styles&skin=fallback"/>' . "\n"
. '<style>.private{}</style>' . "\n"
- 'modules' => [ 'test.private.top' ],
+ 'modules' => [ 'test.private' ],
'only' => ResourceLoaderModule::TYPE_COMBINED,
'only' => ResourceLoaderModule::TYPE_COMBINED,
- 'output' => '<script>(window.RLQ=window.RLQ||[]).push(function(){mw.loader.implement("test.private.top@{blankVer}",function($,jQuery,require,module){},{"css":[]});});</script>',
+ 'output' => '<script>(window.RLQ=window.RLQ||[]).push(function(){mw.loader.implement("test.private@{blankVer}",function($,jQuery,require,module){},{"css":[]});});</script>',
'mediawiki.page.startup',
'test.sinonjs',
],
'mediawiki.page.startup',
'test.sinonjs',
],
'targets' => [ 'desktop', 'mobile' ],
],
'targets' => [ 'desktop', 'mobile' ],
],