* Global version of :js:func:`Test.step_timeout` for use in single page tests. * * @param {Function} func - Function to run after the timeout * @param {number} timeout - Time in ms to wait before running the * test step. The actual wait time is ``timeout`` x * ``timeout_mult
(func, timeout)
| 1275 | * ``timeout_multiplier``. |
| 1276 | */ |
| 1277 | function step_timeout(func, timeout) { |
| 1278 | var outer_this = this; |
| 1279 | var args = Array.prototype.slice.call(arguments, 2); |
| 1280 | var local_set_timeout = typeof global_scope.setTimeout === "undefined" ? fake_set_timeout : setTimeout; |
| 1281 | return local_set_timeout(function() { |
| 1282 | func.apply(outer_this, args); |
| 1283 | }, timeout * tests.timeout_multiplier); |
| 1284 | } |
| 1285 | |
| 1286 | expose(test, 'test'); |
| 1287 | expose(async_test, 'async_test'); |
no test coverage detected