Update web-platform-tests to revision a46616a5b18e83587ddbbed756c7b96cbb4b015d

This commit is contained in:
Josh Matthews 2017-06-19 19:07:14 -04:00 committed by Ms2ger
parent 3f07cfec7c
commit 578498ba24
4001 changed files with 159517 additions and 30260 deletions

View file

@ -112,14 +112,48 @@ ManifestIterator.prototype = {
}
},
matches: function(manifest_item) {
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;
});
// Calculate the location of a match within a provided URL.
//
// @param {string} url - Valid URL
//
// @returns {null|object} - null if the URL does not satisfy the iterator's
// filtering criteria. Otherwise, an object with
// the following properties:
//
// - index - the zero-indexed offset of the start
// of the match
// - width - the total number of matching
// characters
match_location: function(url) {
var match;
if (this.regex_pattern) {
match = url.match(this.regex_pattern);
if (!match) {
return null;
}
return { index: match.index, width: match[0].length };
}
this.paths.some(function(path) {
if (url.indexOf(path) === 0) {
match = path;
return true;
}
return false;
});
if (!match) {
return null;
}
return { index: 0, width: match.length };
},
matches: function(manifest_item) {
return this.match_location(manifest_item.url) !== null;
},
to_test: function(manifest_item) {
@ -231,7 +265,8 @@ VisualOutput.prototype = {
if (subtest_pass_count === subtests_count &&
(status == "OK" || status == "PASS")) {
test_status = "PASS";
} else if (subtest_notrun_count == subtests_count) {
} else if ((!subtests_count && status === "NOTRUN") ||
(subtests_count && (subtest_notrun_count == subtests_count) ) ) {
test_status = "NOTRUN";
} else if (subtests_count > 0 && status === "OK") {
test_status = "FAIL";
@ -292,7 +327,7 @@ VisualOutput.prototype = {
this.meter.textContent = textContent;
this.meter.classList.remove("progress-striped", "active", "stopped", "loading-manifest");
this.meter.classList.add(statusName);
this.runner.test_div.textContent = "";
this.runner.display_current_test(null);
},
on_done: function() {
@ -363,6 +398,7 @@ function ManualUI(elem, runner) {
this.runner = runner;
this.pass_button = this.elem.querySelector("button.pass");
this.fail_button = this.elem.querySelector("button.fail");
this.skip_button = this.elem.querySelector("button.skip");
this.ref_buttons = this.elem.querySelector(".reftestUI");
this.ref_type = this.ref_buttons.querySelector(".refType");
this.ref_warning = this.elem.querySelector(".reftestWarn");
@ -380,6 +416,11 @@ function ManualUI(elem, runner) {
this.runner.on_result("PASS", "", []);
}.bind(this);
this.skip_button.onclick = function() {
this.disable_buttons();
this.runner.on_result("NOTRUN", "", []);
}.bind(this);
this.fail_button.onclick = function() {
this.disable_buttons();
this.runner.on_result("FAIL", "", []);
@ -620,7 +661,8 @@ function Runner(manifest_path) {
this.manifest_iterator = null;
this.test_window = null;
this.test_div = document.getElementById('test_url');
this.test_div = document.getElementById('current_test');
this.test_url = this.test_div.getElementsByTagName('a')[0];
this.current_test = null;
this.timeout = null;
this.num_tests = null;
@ -757,7 +799,7 @@ Runner.prototype = {
this.timeout = setTimeout(this.on_timeout.bind(this),
this.test_timeout * window.testharness_properties.timeout_multiplier);
}
this.test_div.textContent = this.current_test.url;
this.display_current_test(this.current_test.url);
this.load(this.current_test.url);
this.test_start_callbacks.forEach(function(callback) {
@ -765,6 +807,29 @@ Runner.prototype = {
}.bind(this));
},
display_current_test: function(url) {
var match_location, index, width;
if (url === null) {
this.test_div.style.visibility = "hidden";
this.test_url.removeAttribute("href");
this.test_url.textContent = "";
return;
}
match_location = this.manifest_iterator.match_location(url);
index = match_location.index;
width = match_location.width;
this.test_url.setAttribute("href", url);
this.test_url.innerHTML = url.substring(0, index) +
"<span class='match'>" +
url.substring(index, index + width) +
"</span>" +
url.substring(index + width);
this.test_div.style.visibility = "visible";
},
load: function(path) {
this.ensure_test_window();
this.test_window.location.href = this.server + path;