mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision 4d96cccabc2feacd48e1dab9afc22b8af2225572
This commit is contained in:
parent
0d236288cc
commit
c66c6af0ba
1067 changed files with 63768 additions and 10900 deletions
|
@ -22,7 +22,8 @@ policies and contribution forms [3].
|
|||
"normal":10000,
|
||||
"long":60000
|
||||
},
|
||||
test_timeout:null
|
||||
test_timeout:null,
|
||||
message_events: ["start", "test_state", "result", "completion"]
|
||||
};
|
||||
|
||||
var xhtml_ns = "http://www.w3.org/1999/xhtml";
|
||||
|
@ -64,6 +65,40 @@ policies and contribution forms [3].
|
|||
this.output_handler = null;
|
||||
this.all_loaded = false;
|
||||
var this_obj = this;
|
||||
this.message_events = [];
|
||||
|
||||
this.message_functions = {
|
||||
start: [add_start_callback, remove_start_callback,
|
||||
function (properties) {
|
||||
this_obj._dispatch("start_callback", [properties],
|
||||
{type: "start", properties: properties});
|
||||
}],
|
||||
|
||||
test_state: [add_test_state_callback, remove_test_state_callback,
|
||||
function(test) {
|
||||
this_obj._dispatch("test_state_callback", [test],
|
||||
{type: "test_state",
|
||||
test: test.structured_clone()});
|
||||
}],
|
||||
result: [add_result_callback, remove_result_callback,
|
||||
function (test) {
|
||||
this_obj.output_handler.show_status();
|
||||
this_obj._dispatch("result_callback", [test],
|
||||
{type: "result",
|
||||
test: test.structured_clone()});
|
||||
}],
|
||||
completion: [add_completion_callback, remove_completion_callback,
|
||||
function (tests, harness_status) {
|
||||
var cloned_tests = map(tests, function(test) {
|
||||
return test.structured_clone();
|
||||
});
|
||||
this_obj._dispatch("completion_callback", [tests, harness_status],
|
||||
{type: "complete",
|
||||
tests: cloned_tests,
|
||||
status: harness_status.structured_clone()});
|
||||
}]
|
||||
}
|
||||
|
||||
on_event(window, 'load', function() {
|
||||
this_obj.all_loaded = true;
|
||||
});
|
||||
|
@ -150,30 +185,39 @@ policies and contribution forms [3].
|
|||
this.output_handler = output;
|
||||
|
||||
var this_obj = this;
|
||||
|
||||
add_start_callback(function (properties) {
|
||||
this_obj.output_handler.init(properties);
|
||||
this_obj._dispatch("start_callback", [properties],
|
||||
{ type: "start", properties: properties });
|
||||
});
|
||||
|
||||
add_test_state_callback(function(test) {
|
||||
this_obj.output_handler.show_status();
|
||||
this_obj._dispatch("test_state_callback", [test],
|
||||
{ type: "test_state", test: test.structured_clone() });
|
||||
});
|
||||
|
||||
add_result_callback(function (test) {
|
||||
this_obj.output_handler.show_status();
|
||||
this_obj._dispatch("result_callback", [test],
|
||||
{ type: "result", test: test.structured_clone() });
|
||||
});
|
||||
|
||||
add_completion_callback(function (tests, harness_status) {
|
||||
this_obj.output_handler.show_results(tests, harness_status);
|
||||
var cloned_tests = map(tests, function(test) { return test.structured_clone(); });
|
||||
this_obj._dispatch("completion_callback", [tests, harness_status],
|
||||
{ type: "complete", tests: cloned_tests,
|
||||
status: harness_status.structured_clone() });
|
||||
});
|
||||
this.setup_messages(settings.message_events);
|
||||
};
|
||||
|
||||
WindowTestEnvironment.prototype.setup_messages = function(new_events) {
|
||||
var this_obj = this;
|
||||
forEach(settings.message_events, function(x) {
|
||||
var current_dispatch = this_obj.message_events.indexOf(x) !== -1;
|
||||
var new_dispatch = new_events.indexOf(x) !== -1;
|
||||
if (!current_dispatch && new_dispatch) {
|
||||
this_obj.message_functions[x][0](this_obj.message_functions[x][2]);
|
||||
} else if (current_dispatch && !new_dispatch) {
|
||||
this_obj.message_functions[x][1](this_obj.message_functions[x][2]);
|
||||
}
|
||||
});
|
||||
this.message_events = new_events;
|
||||
}
|
||||
|
||||
WindowTestEnvironment.prototype.next_default_test_name = function() {
|
||||
//Don't use document.title to work around an Opera bug in XHTML documents
|
||||
var title = document.getElementsByTagName("title")[0];
|
||||
|
@ -185,6 +229,9 @@ policies and contribution forms [3].
|
|||
|
||||
WindowTestEnvironment.prototype.on_new_harness_properties = function(properties) {
|
||||
this.output_handler.setup(properties);
|
||||
if (properties.hasOwnProperty("message_events")) {
|
||||
this.setup_messages(properties.message_events);
|
||||
}
|
||||
};
|
||||
|
||||
WindowTestEnvironment.prototype.add_on_loaded_callback = function(callback) {
|
||||
|
@ -1448,13 +1495,13 @@ policies and contribution forms [3].
|
|||
RemoteTest.prototype.structured_clone = function() {
|
||||
var clone = {};
|
||||
Object.keys(this).forEach(
|
||||
function(key) {
|
||||
(function(key) {
|
||||
if (typeof(this[key]) === "object") {
|
||||
clone[key] = merge({}, this[key]);
|
||||
} else {
|
||||
clone[key] = this[key];
|
||||
}
|
||||
});
|
||||
}).bind(this));
|
||||
clone.phases = merge({}, this.phases);
|
||||
return clone;
|
||||
};
|
||||
|
@ -1858,14 +1905,12 @@ policies and contribution forms [3].
|
|||
tests.test_state_callbacks.push(callback);
|
||||
}
|
||||
|
||||
function add_result_callback(callback)
|
||||
{
|
||||
function add_result_callback(callback) {
|
||||
tests.test_done_callbacks.push(callback);
|
||||
}
|
||||
|
||||
function add_completion_callback(callback)
|
||||
{
|
||||
tests.all_done_callbacks.push(callback);
|
||||
function add_completion_callback(callback) {
|
||||
tests.all_done_callbacks.push(callback);
|
||||
}
|
||||
|
||||
expose(add_start_callback, 'add_start_callback');
|
||||
|
@ -1873,6 +1918,29 @@ policies and contribution forms [3].
|
|||
expose(add_result_callback, 'add_result_callback');
|
||||
expose(add_completion_callback, 'add_completion_callback');
|
||||
|
||||
function remove(array, item) {
|
||||
var index = array.indexOf(item);
|
||||
if (index > -1) {
|
||||
array.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
function remove_start_callback(callback) {
|
||||
remove(tests.start_callbacks, callback);
|
||||
}
|
||||
|
||||
function remove_test_state_callback(callback) {
|
||||
remove(tests.test_state_callbacks, callback);
|
||||
}
|
||||
|
||||
function remove_result_callback(callback) {
|
||||
remove(tests.test_done_callbacks, callback);
|
||||
}
|
||||
|
||||
function remove_completion_callback(callback) {
|
||||
remove(tests.all_done_callbacks, callback);
|
||||
}
|
||||
|
||||
/*
|
||||
* Output listener
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue