Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-retains-backing.html

Issue 2574543002: Add test to verify that OffscreenCanvas commit() retains canvas contents (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-retains-backing.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-retains-backing.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-retains-backing.html
new file mode 100644
index 0000000000000000000000000000000000000000..347b8df3f05205d60edca5c6b31d920a61239b65
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-retains-backing.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ var canvas = document.createElement('canvas');
+ canvas.width = canvas.height = 10;
+ var offscreen = canvas.transferControlToOffscreen();
+ var ctx = offscreen.getContext('2d');
+ ctx.fillStyle = '#ff0';
+ ctx.fillRect(0, 0, 10, 10);
+ ctx.commit();
+ var pixel = ctx.getImageData(0, 0, 1, 1).data;
+ assert_array_equals(pixel, [255, 255, 0, 255]);
+}, "Verify that commit() preserves the contents of an OffscreenCanvas with a 2d context.");
+</script>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698