-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Import WPT test for canvas filter values
- Loading branch information
1 parent
c524219
commit c279a65
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
Tests/LibWeb/Text/expected/wpt-import/html/canvas/element/filters/2d.filter.value.txt
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,6 @@ | ||
Harness status: OK | ||
|
||
Found 1 tests | ||
|
||
1 Pass | ||
Pass test if ctx.filter works correctly |
56 changes: 56 additions & 0 deletions
56
Tests/LibWeb/Text/input/wpt-import/html/canvas/element/filters/2d.filter.value.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,56 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> | ||
<meta charset="UTF-8"> | ||
<title>Canvas test: 2d.filter.value</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"> | ||
<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> | ||
|