summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.value.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.value.html')
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.value.html56
1 files changed, 56 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.value.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.value.html
new file mode 100644
index 0000000000..5594174cf6
--- /dev/null
+++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.value.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
+<title>OffscreenCanvas 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>
+
+<h1>2d.filter.value</h1>
+<p class="desc">test if ctx.filter works correctly</p>
+
+
+<script>
+var t = async_test("test if ctx.filter works correctly");
+var t_pass = t.done.bind(t);
+var t_fail = t.step_func(function(reason) {
+ throw reason;
+});
+t.step(function() {
+
+ var canvas = new OffscreenCanvas(100, 50);
+ var ctx = canvas.getContext('2d');
+
+ _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)');
+ t.done();
+
+});
+</script>