Update web-platform-tests to revision cbd8c8ca929bc1aea71087be3b826cf1ee189a52

This commit is contained in:
WPT Sync Bot 2019-10-28 10:25:08 +00:00
parent 0c20fba2ab
commit 9c6bf785bd
150 changed files with 1798 additions and 876 deletions

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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;
}

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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();

View file

@ -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>

View file

@ -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();
}