mirror of
https://github.com/servo/servo.git
synced 2025-08-16 19:05:33 +01:00
Update web-platform-tests to revision ea852ede3b4e0632fd453ed520b26b22692c2d92
This commit is contained in:
parent
2ab23c79a7
commit
92fa6ede85
109 changed files with 2169 additions and 873 deletions
|
@ -27,16 +27,20 @@ var t = async_test("Space characters are converted to U+0020 and collapsed (per
|
|||
_addTest(function(canvas, ctx) {
|
||||
|
||||
deferTest();
|
||||
step_timeout(t.step_func_done(function () {
|
||||
ctx.font = '50px CanvasTest';
|
||||
_assertSame(ctx.measureText('A B').width, 150, "ctx.measureText('A B').width", "150");
|
||||
_assertSame(ctx.measureText('A B').width, 150, "ctx.measureText('A B').width", "150");
|
||||
_assertSame(ctx.measureText('A \x09\x0a\x0c\x0d \x09\x0a\x0c\x0dB').width, 150, "ctx.measureText('A \\x09\\x0a\\x0c\\x0d \\x09\\x0a\\x0c\\x0dB').width", "150");
|
||||
_assert(ctx.measureText('A \x0b B').width >= 200, "ctx.measureText('A \\x0b B').width >= 200");
|
||||
var f = new FontFace("CanvasTest", "/fonts/CanvasTest.ttf");
|
||||
document.fonts.add(f);
|
||||
document.fonts.ready.then(() => {
|
||||
step_timeout(t.step_func_done(function () {
|
||||
ctx.font = '50px CanvasTest';
|
||||
_assertSame(ctx.measureText('A B').width, 150, "ctx.measureText('A B').width", "150");
|
||||
_assertSame(ctx.measureText('A B').width, 150, "ctx.measureText('A B').width", "150");
|
||||
_assertSame(ctx.measureText('A \x09\x0a\x0c\x0d \x09\x0a\x0c\x0dB').width, 150, "ctx.measureText('A \\x09\\x0a\\x0c\\x0d \\x09\\x0a\\x0c\\x0dB').width", "150");
|
||||
_assert(ctx.measureText('A \x0b B').width >= 200, "ctx.measureText('A \\x0b B').width >= 200");
|
||||
|
||||
_assertSame(ctx.measureText(' AB').width, 100, "ctx.measureText(' AB').width", "100");
|
||||
_assertSame(ctx.measureText('AB ').width, 100, "ctx.measureText('AB ').width", "100");
|
||||
}), 500);
|
||||
_assertSame(ctx.measureText(' AB').width, 100, "ctx.measureText(' AB').width", "100");
|
||||
_assertSame(ctx.measureText('AB ').width, 100, "ctx.measureText('AB ').width", "100");
|
||||
}), 500);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue