зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1630798 [wpt PR 23036] - Move canvas-filter-value.html to wpt, a=testonly
Automatic update from web-platform-tests Move canvas-filter-value.html to wpt Bug: 1071659 Change-Id: I3d062969335f76fdeef583683bfd390d49b9a21e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2153927 Reviewed-by: Fernando Serboncini <fserb@chromium.org> Commit-Queue: Yi Xu <yiyix@chromium.org> Cr-Commit-Position: refs/heads/master@{#760612} -- wpt-commits: e6147a55a769382e38a115fdfa420f4b11174e6a wpt-pr: 23036
This commit is contained in:
Родитель
ed5cac8065
Коммит
22dffa9a6d
|
@ -0,0 +1,56 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /2dcontext/tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.filter.value</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/2dcontext/resources/canvas-tests.js"></script>
|
||||
<link rel="stylesheet" href="/2dcontext/resources/canvas-tests.css">
|
||||
<body class="show_output">
|
||||
|
||||
<h1>2d.filter.value</h1>
|
||||
<p class="desc">test if ctx.filter works correctly</p>
|
||||
|
||||
|
||||
<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>
|
||||
var t = async_test("test if ctx.filter works correctly");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
_assert(ctx.filter == 'none', "ctx.filter == 'none'");
|
||||
ctx.filter = 'blur(5px)';
|
||||
_assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'");
|
||||
ctx.save();
|
||||
ctx.filter = 'none';
|
||||
_assert(ctx.filter == 'none', "ctx.filter == 'none'");
|
||||
ctx.restore();
|
||||
_assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'");
|
||||
|
||||
ctx.filter = 'blur(10)';
|
||||
_assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'");
|
||||
ctx.filter = 'blur 10px';
|
||||
_assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'");
|
||||
|
||||
ctx.filter = 'inherit';
|
||||
_assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'");
|
||||
ctx.filter = 'initial';
|
||||
_assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'");
|
||||
ctx.filter = 'unset';
|
||||
_assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'");
|
||||
|
||||
ctx.filter = '';
|
||||
_assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'");
|
||||
ctx.filter = null;
|
||||
_assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'");
|
||||
ctx.filter = undefined;
|
||||
_assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'");
|
||||
|
||||
ctx.filter = 'blur( 5px)';
|
||||
assert_equals(ctx.filter, 'blur( 5px)');
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -10328,3 +10328,41 @@
|
|||
var rect = canvas.getBoundingClientRect();
|
||||
@assert Math.round(rect.top) === -8;
|
||||
@assert Math.round(rect.left) === 200;
|
||||
|
||||
- name: 2d.filter.value
|
||||
desc: test if ctx.filter works correctly
|
||||
testing:
|
||||
- 2d.filter.value
|
||||
code: |
|
||||
@assert ctx.filter == 'none';
|
||||
ctx.filter = 'blur(5px)';
|
||||
@assert ctx.filter == 'blur(5px)';
|
||||
ctx.save();
|
||||
ctx.filter = 'none';
|
||||
@assert ctx.filter == 'none';
|
||||
ctx.restore();
|
||||
@assert ctx.filter == 'blur(5px)';
|
||||
|
||||
ctx.filter = 'blur(10)';
|
||||
@assert ctx.filter == 'blur(5px)';
|
||||
ctx.filter = 'blur 10px';
|
||||
@assert ctx.filter == 'blur(5px)';
|
||||
|
||||
ctx.filter = 'inherit';
|
||||
@assert ctx.filter == 'blur(5px)';
|
||||
ctx.filter = 'initial';
|
||||
@assert ctx.filter == 'blur(5px)';
|
||||
ctx.filter = 'unset';
|
||||
@assert ctx.filter == 'blur(5px)';
|
||||
|
||||
ctx.filter = '';
|
||||
@assert ctx.filter == 'blur(5px)';
|
||||
ctx.filter = null;
|
||||
@assert ctx.filter == 'blur(5px)';
|
||||
ctx.filter = undefined;
|
||||
@assert ctx.filter == 'blur(5px)';
|
||||
|
||||
ctx.filter = 'blur( 5px)';
|
||||
assert_equals(ctx.filter, 'blur( 5px)');
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче