mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45: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
|
@ -0,0 +1,37 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.text.measure.baselines
|
||||
// Description:Testing baselines for OffscreenCanvas
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("Testing baselines for OffscreenCanvas");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
deferTest();
|
||||
var f = new FontFace("CanvasTest", "/fonts/CanvasTest.ttf");
|
||||
let fonts = (self.fonts ? self.fonts : document.fonts);
|
||||
fonts.add(f);
|
||||
fonts.ready.then(() => {
|
||||
step_timeout(t.step_func_done(function () {
|
||||
ctx.font = '50px CanvasTest';
|
||||
ctx.direction = 'ltr';
|
||||
ctx.align = 'left'
|
||||
_assertSame(Math.abs(ctx.measureText('A').getBaselines().alphabetic), 0, "Math.abs(ctx.measureText('A').getBaselines().alphabetic)", "0");
|
||||
_assertSame(ctx.measureText('A').getBaselines().ideographic, -39, "ctx.measureText('A').getBaselines().ideographic", "-39");
|
||||
_assertSame(ctx.measureText('A').getBaselines().hanging, 68, "ctx.measureText('A').getBaselines().hanging", "68");
|
||||
|
||||
_assertSame(Math.abs(ctx.measureText('ABCD').getBaselines().alphabetic), 0, "Math.abs(ctx.measureText('ABCD').getBaselines().alphabetic)", "0");
|
||||
_assertSame(ctx.measureText('ABCD').getBaselines().ideographic, -39, "ctx.measureText('ABCD').getBaselines().ideographic", "-39");
|
||||
_assertSame(ctx.measureText('ABCD').getBaselines().hanging, 68, "ctx.measureText('ABCD').getBaselines().hanging", "68");
|
||||
}), 500);
|
||||
});
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
Loading…
Add table
Add a link
Reference in a new issue