resourceloader: Apply safemode to startup module registry
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 28 Mar 2018 00:57:06 +0000 (17:57 -0700)
committerTimo Tijhof <krinklemail@gmail.com>
Sat, 19 May 2018 20:14:33 +0000 (22:14 +0200)
commitee8a5e488edd0551476c5d0e437834f675533901
treea05824d9bccecc05a7bdb89dfabe0c1271f4a0e3
parent90988b3d8897fd2f1384433eaf148e3a02ce61ff
resourceloader: Apply safemode to startup module registry

This effectively applies safemode to the mw.loader client,
without the client itself needing specific knowledge of safemode.

Test Plan:
* Unchanged: When viewing a page in safemode, the 'user' and
  'site' modules are still not queued by OutputPage.
* New: mw.loader.getState('site'), previously would yield
  'registered', but will now yield null.
* New: mw.loader.load('site'), previously loaded the module,
  it now logs a dependency warning for unknown module, like for
  any other unknown module.
* New: mw.loader.using('site'), previously resolved, it is now
  rejected.

Bug: T185303
Change-Id: I672e3891c8e1b3c2d13655fa134d0f1d031b8247
includes/OutputPage.php
includes/resourceloader/ResourceLoaderClientHtml.php
includes/resourceloader/ResourceLoaderModule.php
includes/resourceloader/ResourceLoaderStartUpModule.php
tests/phpunit/ResourceLoaderTestCase.php
tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderStartUpModuleTest.php