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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-messagechannel-imagebitmap-transfer.html

Issue 2541683002: Make ImageBitmap transfers work in cases that require serialization (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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script>
5 async_test(function(t) {
6 var channel = new MessageChannel;
7 channel.port1.onmessage = function(e) {
8 t.step(function() {
9 assert_true(e.data !== null);
10 assert_equals(e.data.width, 10);
11 assert_equals(e.data.height, 10);
12 var destCtx = document.createElement('canvas').getContext('2d');
13 destCtx.drawImage(e.data, 0, 0);
14 var pixel = destCtx.getImageData(5, 5, 1, 1).data;
15 assert_array_equals(pixel, [0, 255, 0, 255]);
16 });
17 t.done();
18 };
19 channel.port1.start();
20 var sourceCanvas = document.createElement('canvas');
21 sourceCanvas.width = sourceCanvas.height = 10;
22 var sourceCtx = sourceCanvas.getContext('2d');
23 sourceCtx.fillStyle = '#0f0';
24 sourceCtx.fillRect(0, 0, 10, 10);
25 createImageBitmap(sourceCanvas).then( bitmap => {
26 channel.port2.postMessage(bitmap, [bitmap]);
27 });
28 }, "Test that an ImageBitmap generated from a canvas survives being transferred via a MessageChannel");
29 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698