mediawiki.requestIdleCallback: Implement timeRemaining()
This matches the native API. This allows callers to better batch and spread out
expensive operations based on actual execution speed.
Right now CentralNotice is manually creating arbitrarily sized batches in
kvStoreMaintenance. Instead this can use a while loop with timeRemaining()
to run as quickly as possible whilst still being able to stop and yield when
it runs for too long. This way will naturally take more iterations on slow
devices and less iterations on faster ones - to be least disruptive.
While timeRemaining() is already available in the native interface,
it was previously unsafe to call because the fallback didn't implement it.
* Remove redundant QUnit.test() expect numbers.
* Add a test for the native one if available. This will catch silly mistakes
like assigning the native one to mw.requestIdleCallback directly that result
in 'Uncaught TypeError: Illegal invocation' due to missing call context.
Change-Id: I9721fab9e89c561e31101b5556a3748431353548