Tests: Fix race-condition broken mw.loader unit test
* testloader.php was resolving dependencies when it shouldn't
the server *never* does that. That's handled by the client, which
knows the state of what is and isn't module.
Due to a race condition between:
- handlePending() call from loader.state() call for
load.phpmodules?=testMissing
- asynchronous callback from mw.loader.using as dependencies
are being resolved.
It didn't expose any actual problem, the unit test was simply
assuming that they would arrive in a certain order, when that isn't
the case by design.
Random failures are seen here:
- https://integration.mediawiki.org/testswarm/user/mediawiki/
- http://integration.wmflabs.org/testswarm/job/4
> Module "test.missing" must have state "missing"
> - "missing"
> + "loading"
-> Because callback was triggered from mw.loader.state() already
it didn't get to the implement() call yet.
> Module "test.use_missing" must have state "error"
> - "error"
> + "loading"
-> (same reason)
This is now fixed.
* Greatly simplified the mock load.php
Change-Id: I000ee726a062f6c6d630ad6c07cfc0b48d145d35