mirror of
https://github.com/servo/servo.git
synced 2025-08-16 10:55:34 +01:00
Update web-platform-tests to revision cbd8c8ca929bc1aea71087be3b826cf1ee189a52
This commit is contained in:
parent
0c20fba2ab
commit
9c6bf785bd
150 changed files with 1798 additions and 876 deletions
|
@ -55,12 +55,17 @@
|
|||
</div>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_true(
|
||||
verifyTextPoints({
|
||||
roundedRect: {x: 0, y: 10, width: 100, height: 100, rx: 50, ry: 50},
|
||||
containerWidth: 200,
|
||||
containerHeight: 200,
|
||||
lineHeight: 10
|
||||
}, 10, 1.5);
|
||||
}, 10, 1.5),
|
||||
"Lines positioned properly around the shape."
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -58,12 +58,17 @@
|
|||
</div>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_true(
|
||||
verifyTextPoints({
|
||||
roundedRect: {x: 0, y: 10, width: 100, height: 100, rx: 50, ry: 50},
|
||||
containerWidth: 200,
|
||||
containerHeight: 200,
|
||||
lineHeight: 10
|
||||
}, 10, 1);
|
||||
}, 10, 1),
|
||||
"Lines positioned properly around the shape."
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -60,12 +60,17 @@
|
|||
</div>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_true(
|
||||
verifyTextPoints({
|
||||
roundedRect: {x: 0, y: 10, width: 100, height: 100, rx: 50, ry: 50},
|
||||
containerWidth: 200,
|
||||
containerHeight: 200,
|
||||
lineHeight: 10
|
||||
}, 10, 1.5);
|
||||
}, 10, 1.5),
|
||||
"Lines positioned properly around the shape."
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -59,12 +59,17 @@
|
|||
</div>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_true(
|
||||
verifyTextPoints({
|
||||
roundedRect: {x: 100, y: 10, width: 100, height: 100, rx: 50, ry: 50},
|
||||
containerWidth: 200,
|
||||
containerHeight: 200,
|
||||
lineHeight: 10
|
||||
}, 10, 1, "right");
|
||||
}, 10, 1, "right"),
|
||||
"Lines positioned properly around the shape."
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function verifyTextPoints(shape, numLines, tolerance, side) {
|
||||
var failed = false;
|
||||
var passed = true;
|
||||
if (tolerance === undefined)
|
||||
tolerance = 0.5;
|
||||
if (side === undefined)
|
||||
|
@ -19,11 +19,9 @@ function verifyTextPoints(shape, numLines, tolerance, side) {
|
|||
if( Math.abs( (actual - expected[i])) > tolerance ){
|
||||
line.style.setProperty('color', 'red');
|
||||
console.log('diff: ' + Math.abs(actual - expected[i]));
|
||||
failed = true;
|
||||
passed = false;
|
||||
}
|
||||
}
|
||||
if (window.done) {
|
||||
assert_false(failed, "Lines positioned properly around the shape.");
|
||||
done();
|
||||
}
|
||||
|
||||
return passed;
|
||||
}
|
||||
|
|
|
@ -32,8 +32,10 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="support/spec-example-utils.js"></script>
|
||||
<script>
|
||||
setup({ single_test: true });
|
||||
function checkFloats() {
|
||||
approxShapeTest('test', 'line-', 2, [182, 199, 201, 199, 182, 0]);
|
||||
done();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -32,8 +32,10 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="support/spec-example-utils.js"></script>
|
||||
<script>
|
||||
setup({ single_test: true });
|
||||
function checkFloats() {
|
||||
approxShapeTest('test', 'line-', 2, [218, 236, 238, 236, 218, 160]);
|
||||
done();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -34,8 +34,10 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="support/spec-example-utils.js"></script>
|
||||
<script>
|
||||
setup({ single_test: true });
|
||||
function checkFloats() {
|
||||
approxShapeTest('test', 'line-', 2, [181, 199, 201, 199, 181, 0]);
|
||||
done();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -42,8 +42,10 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="support/spec-example-utils.js"></script>
|
||||
<script>
|
||||
setup({ single_test: true });
|
||||
function checkFloats() {
|
||||
approxShapeTest('test', 'line-', 2, [200, 214, 216, 214, 200, 158, 0]);
|
||||
done();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -46,8 +46,10 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="support/spec-example-utils.js"></script>
|
||||
<script>
|
||||
setup({ single_test: true });
|
||||
function checkFloats() {
|
||||
approxShapeTest('test', 'line-', 3, [182, 198, 200, 198, 182, 0]);
|
||||
done();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -34,8 +34,10 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="support/spec-example-utils.js"></script>
|
||||
<script>
|
||||
setup({ single_test: true });
|
||||
function checkFloats() {
|
||||
approxShapeTest('test', 'line-', 2, [185, 199, 200, 199, 185, 0]);
|
||||
done();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -34,8 +34,10 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="support/spec-example-utils.js"></script>
|
||||
<script>
|
||||
setup({ single_test: true });
|
||||
function checkFloats() {
|
||||
approxShapeTest('test', 'line-', 2, [185, 199, 200, 199, 185, 0]);
|
||||
done();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -33,8 +33,10 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="support/spec-example-utils.js"></script>
|
||||
<script>
|
||||
setup({ single_test: true });
|
||||
function checkFloats() {
|
||||
approxShapeTest('test', 'line-', 2, [185, 199, 200, 199, 185, 0]);
|
||||
done();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="support/spec-example-utils.js"></script>
|
||||
<script>
|
||||
setup({explicit_done: true});
|
||||
setup({single_test: true});
|
||||
document.fonts.ready.then(()=> {
|
||||
approxShapeTest('test', 'line-', 2, [48, 88, 128, 168, 180, 0]);
|
||||
done();
|
||||
|
|
|
@ -41,8 +41,10 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="support/spec-example-utils.js"></script>
|
||||
<script>
|
||||
setup({ single_test: true });
|
||||
function checkFloats() {
|
||||
approxShapeTest('test', 'line-', 2, [242, 256, 258, 256, 242, 204, 0]);
|
||||
done();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -11,7 +11,6 @@ function approxShapeTest(testId, linePrefix, epsilon, lineOffsets) {
|
|||
var line = document.getElementById(linePrefix + i);
|
||||
assert_approx_equals(line.offsetLeft, lineOffsets[i] + testOffset, epsilon, 'Line ' + i + ' is positioned properly');
|
||||
}
|
||||
done();
|
||||
}
|
||||
runTest();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue