Index: third_party/WebKit/LayoutTests/http/tests/w3c/resources/testharness.js |
diff --git a/third_party/WebKit/LayoutTests/http/tests/w3c/resources/testharness.js b/third_party/WebKit/LayoutTests/http/tests/w3c/resources/testharness.js |
index 9ad4f9aa5c1acdfd6be2c6903f53d7013e92fee2..7920ccd4e80e434a24b13978e9aa5db7031881a2 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/w3c/resources/testharness.js |
+++ b/third_party/WebKit/LayoutTests/http/tests/w3c/resources/testharness.js |
@@ -658,6 +658,14 @@ policies and contribution forms [3]. |
object.addEventListener(event, callback, false); |
} |
+ function step_timeout(f, t) { |
+ var outer_this = this; |
+ var args = Array.prototype.slice.call(arguments, 2); |
+ return setTimeout(function() { |
+ f.apply(outer_this, args); |
+ }, t * tests.timeout_multiplier); |
+ } |
+ |
expose(test, 'test'); |
expose(async_test, 'async_test'); |
expose(promise_test, 'promise_test'); |
@@ -666,6 +674,7 @@ policies and contribution forms [3]. |
expose(setup, 'setup'); |
expose(done, 'done'); |
expose(on_event, 'on_event'); |
+ expose(step_timeout, 'step_timeout'); |
/* |
* Return a string truncated to the given length, with ... added at the end |
@@ -1097,7 +1106,7 @@ policies and contribution forms [3]. |
function _assert_inherits(name) { |
return function (object, property_name, description) |
{ |
- assert(typeof object === "object", |
+ assert(typeof object === "object" || typeof object === "function", |
name, description, |
"provided value is not an object"); |
@@ -1167,6 +1176,7 @@ policies and contribution forms [3]. |
NO_MODIFICATION_ALLOWED_ERR: 'NoModificationAllowedError', |
NOT_FOUND_ERR: 'NotFoundError', |
NOT_SUPPORTED_ERR: 'NotSupportedError', |
+ INUSE_ATTRIBUTE_ERR: 'InUseAttributeError', |
INVALID_STATE_ERR: 'InvalidStateError', |
SYNTAX_ERR: 'SyntaxError', |
INVALID_MODIFICATION_ERR: 'InvalidModificationError', |
@@ -1193,6 +1203,7 @@ policies and contribution forms [3]. |
NoModificationAllowedError: 7, |
NotFoundError: 8, |
NotSupportedError: 9, |
+ InUseAttributeError: 10, |
InvalidStateError: 11, |
SyntaxError: 12, |
InvalidModificationError: 13, |
@@ -1422,6 +1433,14 @@ policies and contribution forms [3]. |
}); |
}; |
+ Test.prototype.step_timeout = function(f, timeout) { |
+ var test_this = this; |
+ var args = Array.prototype.slice.call(arguments, 2); |
+ return setTimeout(this.step_func(function() { |
+ return f.apply(test_this, args); |
+ }, timeout * tests.timeout_multiplier)); |
+ } |
+ |
Test.prototype.add_cleanup = function(callback) { |
this.cleanup_callbacks.push(callback); |
}; |