mirror of
https://github.com/servo/servo.git
synced 2025-08-26 07:38:21 +01:00
Update CSS tests to revision c8ec30de8099360ecf6581035bfdf2180fcc9755
Necessary for: https://github.com/servo/servo/pull/7117
This commit is contained in:
parent
e46499a5df
commit
c51deb9a6e
156 changed files with 13569 additions and 535 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -46,6 +46,10 @@
|
|||
<label for="path" class="col-sm-3 control-label">Run tests under path</label>
|
||||
<div class="col-sm-9">
|
||||
<input value="/" id='path' class='path form-control' disabled>
|
||||
<label>
|
||||
<input type=checkbox id='use_regex'>
|
||||
Use regular expression
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -85,6 +89,7 @@
|
|||
To run a set of
|
||||
<a href="https://github.com/w3c/web-platform-tests/blob/master/README.md">web-platform-tests</a>
|
||||
tests, specify a path value in the <b>Run tests under path</b> field above. Example paths:
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>/</code> - runs all of the tests from the root down</li>
|
||||
<li><code>/websockets</code> - runs all of the
|
||||
|
@ -94,12 +99,25 @@
|
|||
<li><code>/html/syntax/parsing</code> - runs all of the
|
||||
<a href="http://w3c-test.org/html/syntax/parsing/">html/syntax/parsing</a> tests</li>
|
||||
</ul>
|
||||
<p>
|
||||
Multiple test paths can be specified by separating them with comma or whitespace. For example,
|
||||
<code>/js, /html</code> will run the <a href="http://w3c-test.org/js/">js</a> <em>and</em> <a href="http://w3c-test.org/html/">html</a>
|
||||
tests.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.w3schools.com/jsref/jsref_obj_regexp.asp" target="_blank">Javascript regular expressions</a> are also supported for filtering. When the option is checked,
|
||||
only a test path matching the regex pattern will run. For example, you can specify <code>^/js/|^/html/</code>
|
||||
to run the <a href="http://w3c-test.org/js/">js</a> <em>and</em> <a href="http://w3c-test.org/html/">html</a>
|
||||
tests.
|
||||
</p>
|
||||
<p>
|
||||
If the test runner is run online, the set of tests available to run can be found in the
|
||||
<a href="http://w3c-test.org/">w3c-test.org</a> test repository.
|
||||
</p>
|
||||
<p>
|
||||
Tests will run in a new window. For reftests and manual tests it’s best
|
||||
to put that window side-by-side with this one.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div id="output">
|
||||
|
@ -117,18 +135,34 @@
|
|||
<table class='table'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Passed
|
||||
<th>Failed
|
||||
<th>Timeouts
|
||||
<th>Errors
|
||||
<th></th>
|
||||
<th>Passed</th>
|
||||
<th>Failed</th>
|
||||
<th>Timeouts</th>
|
||||
<th>Errors</th>
|
||||
<th>Not Run</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class='PASS'>0
|
||||
<td class='FAIL'>0
|
||||
<td class='TIMEOUT'>0
|
||||
<td class='ERROR'>0
|
||||
<td></td>
|
||||
<td class='PASS'>0</td>
|
||||
<td class='FAIL'>0</td>
|
||||
<td class='TIMEOUT'>0</td>
|
||||
<td class='ERROR'>0</td>
|
||||
<td class='NOTRUN'>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
Display:
|
||||
</label>
|
||||
</td>
|
||||
<td><input type=checkbox class="result-display-filter" value="PASS" checked></td>
|
||||
<td><input type=checkbox class="result-display-filter" value="FAIL" checked></td>
|
||||
<td><input type=checkbox class="result-display-filter" value="TIMEOUT" checked></td>
|
||||
<td><input type=checkbox class="result-display-filter" value="ERROR" checked></td>
|
||||
<td><input type=checkbox class="result-display-filter" value="NOTRUN" checked></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -153,6 +153,10 @@ td.TIMEOUT {
|
|||
color: #f6bb42;
|
||||
}
|
||||
|
||||
td.NOTRUN {
|
||||
color: #00c;
|
||||
}
|
||||
|
||||
td.ERROR {
|
||||
color: #da4453;
|
||||
font-weight: bold;
|
||||
|
|
|
@ -56,13 +56,21 @@ Manifest.prototype = {
|
|||
}
|
||||
};
|
||||
|
||||
function ManifestIterator(manifest, path, test_types) {
|
||||
function ManifestIterator(manifest, path, test_types, use_regex) {
|
||||
this.manifest = manifest;
|
||||
this.path = path;
|
||||
this.paths = null;
|
||||
this.regex_pattern = null;
|
||||
this.test_types = test_types;
|
||||
this.test_types_index = -1;
|
||||
this.test_list = null;
|
||||
this.test_index = null;
|
||||
|
||||
if (use_regex) {
|
||||
this.regex_pattern = path;
|
||||
} else {
|
||||
// Split paths by either a comma or whitespace, and ignore empty sub-strings.
|
||||
this.paths = path.split(/[,\s]+/).filter(function(s) { return s.length > 0 });
|
||||
}
|
||||
}
|
||||
|
||||
ManifestIterator.prototype = {
|
||||
|
@ -94,7 +102,13 @@ ManifestIterator.prototype = {
|
|||
},
|
||||
|
||||
matches: function(manifest_item) {
|
||||
return manifest_item.url.indexOf(this.path) === 0;
|
||||
if (this.regex_pattern !== null) {
|
||||
return manifest_item.url.match(this.regex_pattern);
|
||||
} else {
|
||||
return this.paths.some(function(p) {
|
||||
return manifest_item.url.indexOf(p) === 0;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
to_test: function(manifest_item) {
|
||||
|
@ -138,6 +152,18 @@ function VisualOutput(elem, runner) {
|
|||
this.runner.start_callbacks.push(this.on_start.bind(this));
|
||||
this.runner.result_callbacks.push(this.on_result.bind(this));
|
||||
this.runner.done_callbacks.push(this.on_done.bind(this));
|
||||
|
||||
this.display_filter_state = {};
|
||||
|
||||
var visual_output = this;
|
||||
var display_filter_inputs = this.elem.querySelectorAll(".result-display-filter");
|
||||
for (var i = 0; i < display_filter_inputs.length; ++i) {
|
||||
var display_filter_input = display_filter_inputs[i];
|
||||
this.display_filter_state[display_filter_input.value] = display_filter_input.checked;
|
||||
display_filter_input.addEventListener("change", function(e) {
|
||||
visual_output.apply_display_filter(e.target.value, e.target.checked);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
VisualOutput.prototype = {
|
||||
|
@ -145,7 +171,8 @@ VisualOutput.prototype = {
|
|||
this.result_count = {"PASS":0,
|
||||
"FAIL":0,
|
||||
"ERROR":0,
|
||||
"TIMEOUT":0};
|
||||
"TIMEOUT":0,
|
||||
"NOTRUN":0};
|
||||
for (var p in this.result_count) {
|
||||
if (this.result_count.hasOwnProperty(p)) {
|
||||
this.elem.querySelector("td." + p).textContent = 0;
|
||||
|
@ -183,12 +210,19 @@ VisualOutput.prototype = {
|
|||
var subtest_pass_count = subtests.reduce(function(prev, current) {
|
||||
return (current.status === "PASS") ? prev + 1 : prev;
|
||||
}, 0);
|
||||
|
||||
var subtest_notrun_count = subtests.reduce(function(prev, current) {
|
||||
return (current.status === "NOTRUN") ? prev +1 : prev;
|
||||
}, 0);
|
||||
|
||||
var subtests_count = subtests.length;
|
||||
|
||||
var test_status;
|
||||
if (subtest_pass_count === subtests_count &&
|
||||
(status == "OK" || status == "PASS")) {
|
||||
test_status = "PASS";
|
||||
} else if (subtest_notrun_count == subtests_count) {
|
||||
test_status = "NOTRUN";
|
||||
} else if (subtests_count > 0 && status === "OK") {
|
||||
test_status = "FAIL";
|
||||
} else {
|
||||
|
@ -225,11 +259,12 @@ VisualOutput.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
var status_arr = ["PASS", "FAIL", "ERROR", "TIMEOUT"];
|
||||
var status_arr = ["PASS", "FAIL", "ERROR", "TIMEOUT", "NOTRUN"];
|
||||
for (var i = 0; i < status_arr.length; i++) {
|
||||
this.elem.querySelector("td." + status_arr[i]).textContent = this.result_count[status_arr[i]];
|
||||
}
|
||||
|
||||
this.apply_display_filter_to_result_row(row, this.display_filter_state[test_status]);
|
||||
this.results_table.tBodies[0].appendChild(row);
|
||||
this.update_meter(this.runner.progress(), this.runner.results.count(), this.runner.test_count());
|
||||
},
|
||||
|
@ -287,8 +322,19 @@ VisualOutput.prototype = {
|
|||
this.meter.setAttribute("aria-valuenow", count);
|
||||
this.meter.setAttribute("aria-valuemax", total);
|
||||
this.meter.textContent = this.meter.style.width = (progress * 100).toFixed(1) + "%";
|
||||
}
|
||||
},
|
||||
|
||||
apply_display_filter: function(test_status, display_state) {
|
||||
this.display_filter_state[test_status] = display_state;
|
||||
var result_cells = this.elem.querySelectorAll(".results > table tr td." + test_status);
|
||||
for (var i = 0; i < result_cells.length; ++i) {
|
||||
this.apply_display_filter_to_result_row(result_cells[i].parentNode, display_state)
|
||||
}
|
||||
},
|
||||
|
||||
apply_display_filter_to_result_row: function(result_row, display_state) {
|
||||
result_row.style.display = display_state ? "" : "none";
|
||||
}
|
||||
};
|
||||
|
||||
function ManualUI(elem, runner) {
|
||||
|
@ -374,6 +420,7 @@ ManualUI.prototype = {
|
|||
function TestControl(elem, runner) {
|
||||
this.elem = elem;
|
||||
this.path_input = this.elem.querySelector(".path");
|
||||
this.use_regex_input = this.elem.querySelector("#use_regex");
|
||||
this.pause_button = this.elem.querySelector("button.togglePause");
|
||||
this.start_button = this.elem.querySelector("button.toggleStart");
|
||||
this.type_checkboxes = Array.prototype.slice.call(
|
||||
|
@ -404,7 +451,8 @@ TestControl.prototype = {
|
|||
var path = this.get_path();
|
||||
var test_types = this.get_test_types();
|
||||
var settings = this.get_testharness_settings();
|
||||
this.runner.start(path, test_types, settings);
|
||||
var use_regex = this.get_use_regex();
|
||||
this.runner.start(path, test_types, settings, use_regex);
|
||||
this.set_stop();
|
||||
this.set_pause();
|
||||
}.bind(this);
|
||||
|
@ -458,6 +506,10 @@ TestControl.prototype = {
|
|||
output: this.render_checkbox.checked};
|
||||
},
|
||||
|
||||
get_use_regex: function() {
|
||||
return this.use_regex_input.checked;
|
||||
},
|
||||
|
||||
on_done: function() {
|
||||
this.set_pause();
|
||||
this.set_start();
|
||||
|
@ -549,14 +601,15 @@ Runner.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
start: function(path, test_types, testharness_settings) {
|
||||
start: function(path, test_types, testharness_settings, use_regex) {
|
||||
this.pause_flag = false;
|
||||
this.stop_flag = false;
|
||||
this.done_flag = false;
|
||||
this.path = path;
|
||||
this.use_regex = use_regex;
|
||||
this.test_types = test_types;
|
||||
window.testharness_properties = testharness_settings;
|
||||
this.manifest_iterator = new ManifestIterator(this.manifest, this.path, this.test_types);
|
||||
this.manifest_iterator = new ManifestIterator(this.manifest, this.path, this.test_types, this.use_regex);
|
||||
this.num_tests = null;
|
||||
|
||||
if (this.manifest.data === null) {
|
||||
|
@ -701,13 +754,14 @@ function setup() {
|
|||
if (options.autorun === "1") {
|
||||
runner.start(test_control.get_path(),
|
||||
test_control.get_test_types(),
|
||||
test_control.get_testharness_settings());
|
||||
test_control.get_testharness_settings(),
|
||||
test_control.get_use_regex());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
window.completion_callback = function(tests, status) {
|
||||
var harness_status_map = {0:"OK", 1:"ERROR", 2:"TIMEOUT"};
|
||||
var harness_status_map = {0:"OK", 1:"ERROR", 2:"TIMEOUT", 3:"NOTRUN"};
|
||||
var subtest_status_map = {0:"PASS", 1:"FAIL", 2:"TIMEOUT", 3:"NOTRUN"};
|
||||
|
||||
// this ugly hack is because IE really insists on holding on to the objects it creates in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue