-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[html/canvas] tests for TextMetrics.advances should not be in WPT as …
…this attribute is not in the spec (#46231) Replace 2d.text.measure.advances test with a test that asserts `advances` does not exist, as it is not in the spec.
- Loading branch information
Sam Weinig
authored
May 13, 2024
1 parent
b5d5522
commit 2f33048
Showing
7 changed files
with
77 additions
and
147 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
html/canvas/element/text/2d.text.measure.advances-not-defined.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> | ||
<title>Canvas test: 2d.text.measure.advances-not-defined</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/html/canvas/resources/canvas-tests.js"></script> | ||
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> | ||
<style> | ||
@font-face { | ||
font-family: CanvasTest; | ||
src: url("/fonts/CanvasTest.ttf"); | ||
} | ||
</style> | ||
<body class="show_output"> | ||
|
||
<h1>2d.text.measure.advances-not-defined</h1> | ||
<p class="desc">Testing that TextMetrics.advances is not defined</p> | ||
|
||
|
||
<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span> | ||
<p class="output">Actual output:</p> | ||
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> | ||
|
||
<ul id="d"></ul> | ||
<script> | ||
promise_test(async t => { | ||
|
||
var canvas = document.getElementById('c'); | ||
var ctx = canvas.getContext('2d'); | ||
|
||
ctx.font = '50px CanvasTest'; | ||
_assert(!("advances" in ctx.measureText('Hello')), "!(\"advances\" in ctx.measureText('Hello'))"); | ||
|
||
}, "Testing that TextMetrics.advances is not defined"); | ||
</script> | ||
|
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
html/canvas/offscreen/text/2d.text.measure.advances-not-defined.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> | ||
<title>OffscreenCanvas test: 2d.text.measure.advances-not-defined</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/html/canvas/resources/canvas-tests.js"></script> | ||
|
||
<h1>2d.text.measure.advances-not-defined</h1> | ||
<p class="desc">Testing that TextMetrics.advances is not defined</p> | ||
|
||
|
||
<script> | ||
promise_test(async t => { | ||
|
||
var canvas = new OffscreenCanvas(100, 50); | ||
var ctx = canvas.getContext('2d'); | ||
|
||
ctx.font = '50px CanvasTest'; | ||
_assert(!("advances" in ctx.measureText('Hello')), "!(\"advances\" in ctx.measureText('Hello'))"); | ||
|
||
}, "Testing that TextMetrics.advances is not defined"); | ||
</script> |
16 changes: 16 additions & 0 deletions
16
html/canvas/offscreen/text/2d.text.measure.advances-not-defined.worker.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. | ||
// OffscreenCanvas test in a worker:2d.text.measure.advances-not-defined | ||
// Description:Testing that TextMetrics.advances is not defined | ||
// Note: | ||
|
||
importScripts("/resources/testharness.js"); | ||
importScripts("/html/canvas/resources/canvas-tests.js"); | ||
|
||
promise_test(async t => { | ||
var canvas = new OffscreenCanvas(100, 50); | ||
var ctx = canvas.getContext('2d'); | ||
|
||
ctx.font = '50px CanvasTest'; | ||
_assert(!("advances" in ctx.measureText('Hello')), "!(\"advances\" in ctx.measureText('Hello'))"); | ||
}, "Testing that TextMetrics.advances is not defined"); | ||
done(); |
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
html/canvas/offscreen/text/2d.text.measure.advances.worker.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters