mirror of
https://github.com/servo/servo.git
synced 2025-09-04 12:08:21 +01:00
Update web-platform-tests to revision c0fbd59769588391d78838086bd02ad394301655
This commit is contained in:
parent
a07c718895
commit
a3df7c3a3c
105 changed files with 1922 additions and 1186 deletions
|
@ -9,13 +9,33 @@
|
|||
var subTestEnd = Infinity;
|
||||
var match;
|
||||
if (location.search) {
|
||||
match = /(?:^\?|&)(\d+)-(\d+|last)(?:&|$)/.exec(location.search);
|
||||
if (match) {
|
||||
subTestStart = parseInt(match[1], 10);
|
||||
if (match[2] !== "last") {
|
||||
subTestEnd = parseInt(match[2], 10);
|
||||
}
|
||||
match = /(?:^\?|&)(\d+)-(\d+|last)(?:&|$)/.exec(location.search);
|
||||
if (match) {
|
||||
subTestStart = parseInt(match[1], 10);
|
||||
if (match[2] !== "last") {
|
||||
subTestEnd = parseInt(match[2], 10);
|
||||
}
|
||||
}
|
||||
// Below is utility code to generate <meta> for copy/paste into tests.
|
||||
// Sample usage:
|
||||
// test.html?split=1000
|
||||
match = /(?:^\?|&)split=(\d+)(?:&|$)/.exec(location.search);
|
||||
if (match) {
|
||||
var testsPerVariant = parseInt(match[1], 10);
|
||||
add_completion_callback(tests => {
|
||||
var total = tests.length;
|
||||
var template = '<meta name="variant" content="?%s-%s">';
|
||||
var metas = [];
|
||||
for (var i = 1; i < total - testsPerVariant; i = i + testsPerVariant) {
|
||||
metas.push(template.replace("%s", i).replace("%s", i + testsPerVariant - 1));
|
||||
}
|
||||
metas.push(template.replace("%s", i).replace("%s", "last"));
|
||||
var pre = document.createElement('pre');
|
||||
pre.textContent = metas.join('\n');
|
||||
document.body.insertBefore(pre, document.body.firstChild);
|
||||
document.getSelection().selectAllChildren(pre);
|
||||
});
|
||||
}
|
||||
}
|
||||
function shouldRunSubTest(currentSubTest) {
|
||||
return currentSubTest >= subTestStart && currentSubTest <= subTestEnd;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue