Commit 38dd96cf authored by jsbell's avatar jsbell Committed by Commit bot

Update testharness.js and friends (and duplicate copies)

testharness.js - https://github.com/w3c/testharness.js
commit: 8658d6ca31d086e695b333aef55bb388091c7049
files: testharness.js idlharness.js

webidl2.js - https://github.com/darobin/webidl2.js
commit: bd216bcd5596d60734450adc938155deab1e1a80
files: WebIDLParser.js (orig: webidl2.js)

Related files testharness.css and vendor-prefix.js did not require
updates - see LayoutTests/resources/README.txt

BUG=561708
R=domenic@chromium.org

Review URL: https://codereview.chromium.org/1493473002

Cr-Commit-Position: refs/heads/master@{#363015}
parent 52ff65b5
...@@ -658,6 +658,14 @@ policies and contribution forms [3]. ...@@ -658,6 +658,14 @@ policies and contribution forms [3].
object.addEventListener(event, callback, false); 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(test, 'test');
expose(async_test, 'async_test'); expose(async_test, 'async_test');
expose(promise_test, 'promise_test'); expose(promise_test, 'promise_test');
...@@ -666,6 +674,7 @@ policies and contribution forms [3]. ...@@ -666,6 +674,7 @@ policies and contribution forms [3].
expose(setup, 'setup'); expose(setup, 'setup');
expose(done, 'done'); expose(done, 'done');
expose(on_event, 'on_event'); expose(on_event, 'on_event');
expose(step_timeout, 'step_timeout');
/* /*
* Return a string truncated to the given length, with ... added at the end * Return a string truncated to the given length, with ... added at the end
...@@ -1097,7 +1106,7 @@ policies and contribution forms [3]. ...@@ -1097,7 +1106,7 @@ policies and contribution forms [3].
function _assert_inherits(name) { function _assert_inherits(name) {
return function (object, property_name, description) return function (object, property_name, description)
{ {
assert(typeof object === "object", assert(typeof object === "object" || typeof object === "function",
name, description, name, description,
"provided value is not an object"); "provided value is not an object");
...@@ -1167,6 +1176,7 @@ policies and contribution forms [3]. ...@@ -1167,6 +1176,7 @@ policies and contribution forms [3].
NO_MODIFICATION_ALLOWED_ERR: 'NoModificationAllowedError', NO_MODIFICATION_ALLOWED_ERR: 'NoModificationAllowedError',
NOT_FOUND_ERR: 'NotFoundError', NOT_FOUND_ERR: 'NotFoundError',
NOT_SUPPORTED_ERR: 'NotSupportedError', NOT_SUPPORTED_ERR: 'NotSupportedError',
INUSE_ATTRIBUTE_ERR: 'InUseAttributeError',
INVALID_STATE_ERR: 'InvalidStateError', INVALID_STATE_ERR: 'InvalidStateError',
SYNTAX_ERR: 'SyntaxError', SYNTAX_ERR: 'SyntaxError',
INVALID_MODIFICATION_ERR: 'InvalidModificationError', INVALID_MODIFICATION_ERR: 'InvalidModificationError',
...@@ -1193,6 +1203,7 @@ policies and contribution forms [3]. ...@@ -1193,6 +1203,7 @@ policies and contribution forms [3].
NoModificationAllowedError: 7, NoModificationAllowedError: 7,
NotFoundError: 8, NotFoundError: 8,
NotSupportedError: 9, NotSupportedError: 9,
InUseAttributeError: 10,
InvalidStateError: 11, InvalidStateError: 11,
SyntaxError: 12, SyntaxError: 12,
InvalidModificationError: 13, InvalidModificationError: 13,
...@@ -1422,6 +1433,14 @@ policies and contribution forms [3]. ...@@ -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) { Test.prototype.add_cleanup = function(callback) {
this.cleanup_callbacks.push(callback); this.cleanup_callbacks.push(callback);
}; };
......
...@@ -214,8 +214,7 @@ ...@@ -214,8 +214,7 @@
ret.idlType = type() || error("Error parsing generic type " + value); ret.idlType = type() || error("Error parsing generic type " + value);
all_ws(); all_ws();
if (!consume(OTHER, ">")) error("Unterminated generic type " + value); if (!consume(OTHER, ">")) error("Unterminated generic type " + value);
all_ws(); type_suffix(ret);
if (consume(OTHER, "?")) ret.nullable = true;
return ret; return ret;
} }
else { else {
...@@ -331,8 +330,25 @@ ...@@ -331,8 +330,25 @@
all_ws(); all_ws();
var eq = consume(OTHER, "="); var eq = consume(OTHER, "=");
if (eq) { if (eq) {
var rhs;
all_ws(); all_ws();
ret.rhs = consume(ID); if (rhs = consume(ID)) {
ret.rhs = rhs
}
else if (consume(OTHER, "(")) {
// [Exposed=(Window,Worker)]
rhs = [];
var id = consume(ID);
if (id) {
rhs = [id.value];
}
identifiers(rhs);
consume(OTHER, ")") || error("Unexpected token in extended attribute argument list or type pair");
ret.rhs = {
type: "identifier-list",
value: rhs
};
}
if (!ret.rhs) return error("No right hand side to extended attribute assignment"); if (!ret.rhs) return error("No right hand side to extended attribute assignment");
} }
all_ws(); all_ws();
...@@ -380,6 +396,10 @@ ...@@ -380,6 +396,10 @@
if (def) { if (def) {
return def; return def;
} }
else if (consume(OTHER, "[")) {
if (!consume(OTHER, "]")) error("Default sequence value must be empty");
return { type: "sequence", value: [] };
}
else { else {
var str = consume(STR) || error("No value for default"); var str = consume(STR) || error("No value for default");
str.value = str.value.replace(/^"/, "").replace(/"$/, ""); str.value = str.value.replace(/^"/, "").replace(/"$/, "");
...@@ -562,7 +582,7 @@ ...@@ -562,7 +582,7 @@
return ret; return ret;
} }
else if (consume(ID, "stringifier")) { else if (consume(ID, "stringifier")) {
ret.stringifier = true; ret.stringifier = true;-
all_ws(); all_ws();
if (consume(OTHER, ";")) return ret; if (consume(OTHER, ";")) return ret;
ret.idlType = return_type(); ret.idlType = return_type();
...@@ -668,6 +688,69 @@ ...@@ -668,6 +688,69 @@
return ret; return ret;
}; };
var iterable_type = function() {
if (consume(ID, "iterable")) return "iterable";
else if (consume(ID, "legacyiterable")) return "legacyiterable";
else if (consume(ID, "maplike")) return "maplike";
else if (consume(ID, "setlike")) return "setlike";
else return;
}
var readonly_iterable_type = function() {
if (consume(ID, "maplike")) return "maplike";
else if (consume(ID, "setlike")) return "setlike";
else return;
}
var iterable = function (store) {
all_ws(store, "pea");
var grabbed = [],
ret = {type: null, idlType: null, readonly: false};
if (consume(ID, "readonly")) {
ret.readonly = true;
grabbed.push(last_token);
var w = all_ws();
if (w) grabbed.push(w);
}
var consumeItType = ret.readonly ? readonly_iterable_type : iterable_type;
var ittype = consumeItType();
if (!ittype) {
tokens = grabbed.concat(tokens);
return;
}
var secondTypeRequired = ittype === "maplike";
var secondTypeAllowed = secondTypeRequired || ittype === "iterable";
ret.type = ittype;
if (ret.type !== 'maplike' && ret.type !== 'setlike')
delete ret.readonly;
all_ws();
if (consume(OTHER, "<")) {
ret.idlType = type() || error("Error parsing " + ittype + " declaration");
all_ws();
if (secondTypeAllowed) {
var type2 = null;
if (consume(OTHER, ",")) {
all_ws();
type2 = type();
all_ws();
}
if (type2)
ret.idlType = [ret.idlType, type2];
else if (secondTypeRequired)
error("Missing second type argument in " + ittype + " declaration");
}
if (!consume(OTHER, ">")) error("Unterminated " + ittype + " declaration");
all_ws();
if (!consume(OTHER, ";")) error("Missing semicolon after " + ittype + " declaration");
}
else
error("Error parsing " + ittype + " declaration");
return ret;
}
var interface_ = function (isPartial, store) { var interface_ = function (isPartial, store) {
all_ws(isPartial ? null : store, "pea"); all_ws(isPartial ? null : store, "pea");
if (!consume(ID, "interface")) return; if (!consume(ID, "interface")) return;
...@@ -698,7 +781,9 @@ ...@@ -698,7 +781,9 @@
ret.members.push(cnt); ret.members.push(cnt);
continue; continue;
} }
var mem = serialiser(store ? mems : null) || var mem = (opt.allowNestedTypedefs && typedef(store ? mems : null)) ||
iterable(store ? mems : null) ||
serialiser(store ? mems : null) ||
attribute(store ? mems : null) || attribute(store ? mems : null) ||
operation(store ? mems : null) || operation(store ? mems : null) ||
error("Unknown member"); error("Unknown member");
...@@ -741,15 +826,19 @@ ...@@ -741,15 +826,19 @@
} }
var ea = extended_attrs(store ? mems : null); var ea = extended_attrs(store ? mems : null);
all_ws(store ? mems : null, "pea"); all_ws(store ? mems : null, "pea");
var required = consume(ID, "required");
var typ = type() || error("No type for dictionary member"); var typ = type() || error("No type for dictionary member");
all_ws(); all_ws();
var name = consume(ID) || error("No name for dictionary member"); var name = consume(ID) || error("No name for dictionary member");
var dflt = default_();
if (required && dflt) error("Required member must not have a default");
ret.members.push({ ret.members.push({
type: "field" type: "field"
, name: name.value , name: name.value
, required: !!required
, idlType: typ , idlType: typ
, extAttrs: ea , extAttrs: ea
, "default": default_() , "default": dflt
}); });
all_ws(); all_ws();
consume(OTHER, ";") || error("Unterminated dictionary member"); consume(OTHER, ";") || error("Unterminated dictionary member");
...@@ -818,7 +907,6 @@ ...@@ -818,7 +907,6 @@
all_ws(store ? vals : null); all_ws(store ? vals : null);
if (consume(OTHER, "}")) { if (consume(OTHER, "}")) {
all_ws(); all_ws();
if (saw_comma) error("Trailing comma in enum");
consume(OTHER, ";") || error("No semicolon after enum"); consume(OTHER, ";") || error("No semicolon after enum");
return ret; return ret;
} }
......
...@@ -1286,15 +1286,10 @@ IdlInterface.prototype.test_object = function(desc) ...@@ -1286,15 +1286,10 @@ IdlInterface.prototype.test_object = function(desc)
exception = e; exception = e;
} }
// TODO: WebIDLParser doesn't currently support named legacycallers, so I'm var expected_typeof =
// not sure what those would look like in the AST this.members.some(function(member) { return member.legacycaller; })
var expected_typeof = this.members.some(function(member) ? "function"
{ : "object";
return member.legacycaller
|| ("idlType" in member && member.idlType.legacycaller)
|| ("idlType" in member && typeof member.idlType == "object"
&& "idlType" in member.idlType && member.idlType.idlType == "legacycaller");
}) ? "function" : "object";
this.test_primary_interface_of(desc, obj, exception, expected_typeof); this.test_primary_interface_of(desc, obj, exception, expected_typeof);
var current_interface = this; var current_interface = this;
......
...@@ -658,6 +658,14 @@ policies and contribution forms [3]. ...@@ -658,6 +658,14 @@ policies and contribution forms [3].
object.addEventListener(event, callback, false); 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(test, 'test');
expose(async_test, 'async_test'); expose(async_test, 'async_test');
expose(promise_test, 'promise_test'); expose(promise_test, 'promise_test');
...@@ -666,6 +674,7 @@ policies and contribution forms [3]. ...@@ -666,6 +674,7 @@ policies and contribution forms [3].
expose(setup, 'setup'); expose(setup, 'setup');
expose(done, 'done'); expose(done, 'done');
expose(on_event, 'on_event'); expose(on_event, 'on_event');
expose(step_timeout, 'step_timeout');
/* /*
* Return a string truncated to the given length, with ... added at the end * Return a string truncated to the given length, with ... added at the end
...@@ -1097,7 +1106,7 @@ policies and contribution forms [3]. ...@@ -1097,7 +1106,7 @@ policies and contribution forms [3].
function _assert_inherits(name) { function _assert_inherits(name) {
return function (object, property_name, description) return function (object, property_name, description)
{ {
assert(typeof object === "object", assert(typeof object === "object" || typeof object === "function",
name, description, name, description,
"provided value is not an object"); "provided value is not an object");
...@@ -1167,6 +1176,7 @@ policies and contribution forms [3]. ...@@ -1167,6 +1176,7 @@ policies and contribution forms [3].
NO_MODIFICATION_ALLOWED_ERR: 'NoModificationAllowedError', NO_MODIFICATION_ALLOWED_ERR: 'NoModificationAllowedError',
NOT_FOUND_ERR: 'NotFoundError', NOT_FOUND_ERR: 'NotFoundError',
NOT_SUPPORTED_ERR: 'NotSupportedError', NOT_SUPPORTED_ERR: 'NotSupportedError',
INUSE_ATTRIBUTE_ERR: 'InUseAttributeError',
INVALID_STATE_ERR: 'InvalidStateError', INVALID_STATE_ERR: 'InvalidStateError',
SYNTAX_ERR: 'SyntaxError', SYNTAX_ERR: 'SyntaxError',
INVALID_MODIFICATION_ERR: 'InvalidModificationError', INVALID_MODIFICATION_ERR: 'InvalidModificationError',
...@@ -1193,6 +1203,7 @@ policies and contribution forms [3]. ...@@ -1193,6 +1203,7 @@ policies and contribution forms [3].
NoModificationAllowedError: 7, NoModificationAllowedError: 7,
NotFoundError: 8, NotFoundError: 8,
NotSupportedError: 9, NotSupportedError: 9,
InUseAttributeError: 10,
InvalidStateError: 11, InvalidStateError: 11,
SyntaxError: 12, SyntaxError: 12,
InvalidModificationError: 13, InvalidModificationError: 13,
...@@ -1422,6 +1433,14 @@ policies and contribution forms [3]. ...@@ -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) { Test.prototype.add_cleanup = function(callback) {
this.cleanup_callbacks.push(callback); this.cleanup_callbacks.push(callback);
}; };
......
...@@ -214,8 +214,7 @@ ...@@ -214,8 +214,7 @@
ret.idlType = type() || error("Error parsing generic type " + value); ret.idlType = type() || error("Error parsing generic type " + value);
all_ws(); all_ws();
if (!consume(OTHER, ">")) error("Unterminated generic type " + value); if (!consume(OTHER, ">")) error("Unterminated generic type " + value);
all_ws(); type_suffix(ret);
if (consume(OTHER, "?")) ret.nullable = true;
return ret; return ret;
} }
else { else {
...@@ -331,8 +330,25 @@ ...@@ -331,8 +330,25 @@
all_ws(); all_ws();
var eq = consume(OTHER, "="); var eq = consume(OTHER, "=");
if (eq) { if (eq) {
var rhs;
all_ws(); all_ws();
ret.rhs = consume(ID); if (rhs = consume(ID)) {
ret.rhs = rhs
}
else if (consume(OTHER, "(")) {
// [Exposed=(Window,Worker)]
rhs = [];
var id = consume(ID);
if (id) {
rhs = [id.value];
}
identifiers(rhs);
consume(OTHER, ")") || error("Unexpected token in extended attribute argument list or type pair");
ret.rhs = {
type: "identifier-list",
value: rhs
};
}
if (!ret.rhs) return error("No right hand side to extended attribute assignment"); if (!ret.rhs) return error("No right hand side to extended attribute assignment");
} }
all_ws(); all_ws();
...@@ -380,6 +396,10 @@ ...@@ -380,6 +396,10 @@
if (def) { if (def) {
return def; return def;
} }
else if (consume(OTHER, "[")) {
if (!consume(OTHER, "]")) error("Default sequence value must be empty");
return { type: "sequence", value: [] };
}
else { else {
var str = consume(STR) || error("No value for default"); var str = consume(STR) || error("No value for default");
str.value = str.value.replace(/^"/, "").replace(/"$/, ""); str.value = str.value.replace(/^"/, "").replace(/"$/, "");
...@@ -562,7 +582,7 @@ ...@@ -562,7 +582,7 @@
return ret; return ret;
} }
else if (consume(ID, "stringifier")) { else if (consume(ID, "stringifier")) {
ret.stringifier = true; ret.stringifier = true;-
all_ws(); all_ws();
if (consume(OTHER, ";")) return ret; if (consume(OTHER, ";")) return ret;
ret.idlType = return_type(); ret.idlType = return_type();
...@@ -668,6 +688,69 @@ ...@@ -668,6 +688,69 @@
return ret; return ret;
}; };
var iterable_type = function() {
if (consume(ID, "iterable")) return "iterable";
else if (consume(ID, "legacyiterable")) return "legacyiterable";
else if (consume(ID, "maplike")) return "maplike";
else if (consume(ID, "setlike")) return "setlike";
else return;
}
var readonly_iterable_type = function() {
if (consume(ID, "maplike")) return "maplike";
else if (consume(ID, "setlike")) return "setlike";
else return;
}
var iterable = function (store) {
all_ws(store, "pea");
var grabbed = [],
ret = {type: null, idlType: null, readonly: false};
if (consume(ID, "readonly")) {
ret.readonly = true;
grabbed.push(last_token);
var w = all_ws();
if (w) grabbed.push(w);
}
var consumeItType = ret.readonly ? readonly_iterable_type : iterable_type;
var ittype = consumeItType();
if (!ittype) {
tokens = grabbed.concat(tokens);
return;
}
var secondTypeRequired = ittype === "maplike";
var secondTypeAllowed = secondTypeRequired || ittype === "iterable";
ret.type = ittype;
if (ret.type !== 'maplike' && ret.type !== 'setlike')
delete ret.readonly;
all_ws();
if (consume(OTHER, "<")) {
ret.idlType = type() || error("Error parsing " + ittype + " declaration");
all_ws();
if (secondTypeAllowed) {
var type2 = null;
if (consume(OTHER, ",")) {
all_ws();
type2 = type();
all_ws();
}
if (type2)
ret.idlType = [ret.idlType, type2];
else if (secondTypeRequired)
error("Missing second type argument in " + ittype + " declaration");
}
if (!consume(OTHER, ">")) error("Unterminated " + ittype + " declaration");
all_ws();
if (!consume(OTHER, ";")) error("Missing semicolon after " + ittype + " declaration");
}
else
error("Error parsing " + ittype + " declaration");
return ret;
}
var interface_ = function (isPartial, store) { var interface_ = function (isPartial, store) {
all_ws(isPartial ? null : store, "pea"); all_ws(isPartial ? null : store, "pea");
if (!consume(ID, "interface")) return; if (!consume(ID, "interface")) return;
...@@ -698,7 +781,9 @@ ...@@ -698,7 +781,9 @@
ret.members.push(cnt); ret.members.push(cnt);
continue; continue;
} }
var mem = serialiser(store ? mems : null) || var mem = (opt.allowNestedTypedefs && typedef(store ? mems : null)) ||
iterable(store ? mems : null) ||
serialiser(store ? mems : null) ||
attribute(store ? mems : null) || attribute(store ? mems : null) ||
operation(store ? mems : null) || operation(store ? mems : null) ||
error("Unknown member"); error("Unknown member");
...@@ -741,15 +826,19 @@ ...@@ -741,15 +826,19 @@
} }
var ea = extended_attrs(store ? mems : null); var ea = extended_attrs(store ? mems : null);
all_ws(store ? mems : null, "pea"); all_ws(store ? mems : null, "pea");
var required = consume(ID, "required");
var typ = type() || error("No type for dictionary member"); var typ = type() || error("No type for dictionary member");
all_ws(); all_ws();
var name = consume(ID) || error("No name for dictionary member"); var name = consume(ID) || error("No name for dictionary member");
var dflt = default_();
if (required && dflt) error("Required member must not have a default");
ret.members.push({ ret.members.push({
type: "field" type: "field"
, name: name.value , name: name.value
, required: !!required
, idlType: typ , idlType: typ
, extAttrs: ea , extAttrs: ea
, "default": default_() , "default": dflt
}); });
all_ws(); all_ws();
consume(OTHER, ";") || error("Unterminated dictionary member"); consume(OTHER, ";") || error("Unterminated dictionary member");
...@@ -818,7 +907,6 @@ ...@@ -818,7 +907,6 @@
all_ws(store ? vals : null); all_ws(store ? vals : null);
if (consume(OTHER, "}")) { if (consume(OTHER, "}")) {
all_ws(); all_ws();
if (saw_comma) error("Trailing comma in enum");
consume(OTHER, ";") || error("No semicolon after enum"); consume(OTHER, ";") || error("No semicolon after enum");
return ret; return ret;
} }
......
...@@ -1286,15 +1286,10 @@ IdlInterface.prototype.test_object = function(desc) ...@@ -1286,15 +1286,10 @@ IdlInterface.prototype.test_object = function(desc)
exception = e; exception = e;
} }
// TODO: WebIDLParser doesn't currently support named legacycallers, so I'm var expected_typeof =
// not sure what those would look like in the AST this.members.some(function(member) { return member.legacycaller; })
var expected_typeof = this.members.some(function(member) ? "function"
{ : "object";
return member.legacycaller
|| ("idlType" in member && member.idlType.legacycaller)
|| ("idlType" in member && typeof member.idlType == "object"
&& "idlType" in member.idlType && member.idlType.idlType == "legacycaller");
}) ? "function" : "object";
this.test_primary_interface_of(desc, obj, exception, expected_typeof); this.test_primary_interface_of(desc, obj, exception, expected_typeof);
var current_interface = this; var current_interface = this;
......
...@@ -658,6 +658,14 @@ policies and contribution forms [3]. ...@@ -658,6 +658,14 @@ policies and contribution forms [3].
object.addEventListener(event, callback, false); 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(test, 'test');
expose(async_test, 'async_test'); expose(async_test, 'async_test');
expose(promise_test, 'promise_test'); expose(promise_test, 'promise_test');
...@@ -666,6 +674,7 @@ policies and contribution forms [3]. ...@@ -666,6 +674,7 @@ policies and contribution forms [3].
expose(setup, 'setup'); expose(setup, 'setup');
expose(done, 'done'); expose(done, 'done');
expose(on_event, 'on_event'); expose(on_event, 'on_event');
expose(step_timeout, 'step_timeout');
/* /*
* Return a string truncated to the given length, with ... added at the end * Return a string truncated to the given length, with ... added at the end
...@@ -1097,7 +1106,7 @@ policies and contribution forms [3]. ...@@ -1097,7 +1106,7 @@ policies and contribution forms [3].
function _assert_inherits(name) { function _assert_inherits(name) {
return function (object, property_name, description) return function (object, property_name, description)
{ {
assert(typeof object === "object", assert(typeof object === "object" || typeof object === "function",
name, description, name, description,
"provided value is not an object"); "provided value is not an object");
...@@ -1167,6 +1176,7 @@ policies and contribution forms [3]. ...@@ -1167,6 +1176,7 @@ policies and contribution forms [3].
NO_MODIFICATION_ALLOWED_ERR: 'NoModificationAllowedError', NO_MODIFICATION_ALLOWED_ERR: 'NoModificationAllowedError',
NOT_FOUND_ERR: 'NotFoundError', NOT_FOUND_ERR: 'NotFoundError',
NOT_SUPPORTED_ERR: 'NotSupportedError', NOT_SUPPORTED_ERR: 'NotSupportedError',
INUSE_ATTRIBUTE_ERR: 'InUseAttributeError',
INVALID_STATE_ERR: 'InvalidStateError', INVALID_STATE_ERR: 'InvalidStateError',
SYNTAX_ERR: 'SyntaxError', SYNTAX_ERR: 'SyntaxError',
INVALID_MODIFICATION_ERR: 'InvalidModificationError', INVALID_MODIFICATION_ERR: 'InvalidModificationError',
...@@ -1193,6 +1203,7 @@ policies and contribution forms [3]. ...@@ -1193,6 +1203,7 @@ policies and contribution forms [3].
NoModificationAllowedError: 7, NoModificationAllowedError: 7,
NotFoundError: 8, NotFoundError: 8,
NotSupportedError: 9, NotSupportedError: 9,
InUseAttributeError: 10,
InvalidStateError: 11, InvalidStateError: 11,
SyntaxError: 12, SyntaxError: 12,
InvalidModificationError: 13, InvalidModificationError: 13,
...@@ -1422,6 +1433,14 @@ policies and contribution forms [3]. ...@@ -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) { Test.prototype.add_cleanup = function(callback) {
this.cleanup_callbacks.push(callback); this.cleanup_callbacks.push(callback);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment