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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-ImageBitmap-transferable.html

Issue 1589923002: Add more layout test cases to createImageBitmap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update layout test result Created 4 years, 11 months 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/LayoutTests/fast/canvas/canvas-ImageBitmap-transferable-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <canvas id="canvas" width="3" height="2"></canvas> 4 <canvas id="canvas" width="3" height="2"></canvas>
5 <script src="../../resources/js-test.js"></script> 5 <script src="../../resources/js-test.js"></script>
6 <script> 6 <script>
7 jsTestIsAsync = true; 7 jsTestIsAsync = true;
8 var worker = new Worker('./resources/canvas-ImageBitmap-transferable.js'); 8 var worker = new Worker('./resources/canvas-ImageBitmap-transferable.js');
9 9
10 description("Tests that ImageBitmap is transferable and that the pixel data surv ives the trip, as well as createImageBitmap(ImageBitmap) works on worker thread" ); 10 description("Tests that ImageBitmap is transferable and that the pixel data surv ives the trip, as well as createImageBitmap(ImageBitmap) works on worker thread" );
(...skipping 21 matching lines...) Expand all
32 shouldBe("bitmapHeight", "imageHeight"); 32 shouldBe("bitmapHeight", "imageHeight");
33 33
34 worker.postMessage({data: imageBitmap}, [imageBitmap]); 34 worker.postMessage({data: imageBitmap}, [imageBitmap]);
35 35
36 // ImageBitmap has been transfered to worker, main thread loses ownership 36 // ImageBitmap has been transfered to worker, main thread loses ownership
37 // of it, so the width and height should be 0 now. 37 // of it, so the width and height should be 0 now.
38 bitmapWidth = imageBitmap.width; 38 bitmapWidth = imageBitmap.width;
39 bitmapHeight = imageBitmap.height; 39 bitmapHeight = imageBitmap.height;
40 shouldBe("bitmapWidth", "0"); 40 shouldBe("bitmapWidth", "0");
41 shouldBe("bitmapHeight", "0"); 41 shouldBe("bitmapHeight", "0");
42
43 newImageBitmap = imageBitmap;
44 // Test createImageBitmap from neutered ImageBitmap
45 createImageBitmap(imageBitmap).then(function() {
46 testFailed("Promise accepted, expected to be rejected");
47 finishJSTest();
48 }, () => {
49 testPassed("createImageBitmap from a neutered ImageBitmap was rejected");
50 });
42 }); 51 });
43 52
44 worker.onmessage = function(e) { 53 worker.onmessage = function(e) {
45 newImageBitmap = e.data.data; 54 newImageBitmap = e.data.data;
46 bitmapWidth = newImageBitmap.width; 55 bitmapWidth = newImageBitmap.width;
47 bitmapHeight = newImageBitmap.height; 56 bitmapHeight = newImageBitmap.height;
48 57
49 // Getting the ImageBitmap back from the worker thread 58 // Getting the ImageBitmap back from the worker thread
50 shouldBe("bitmapWidth", "imageWidth"); 59 shouldBe("bitmapWidth", "imageWidth");
51 shouldBe("bitmapHeight", "imageHeight"); 60 shouldBe("bitmapHeight", "imageHeight");
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 shouldBeCloseTo("newImage.data[20]", "image.data[20]", 5); 94 shouldBeCloseTo("newImage.data[20]", "image.data[20]", 5);
86 shouldBeCloseTo("newImage.data[21]", "image.data[21]", 5); 95 shouldBeCloseTo("newImage.data[21]", "image.data[21]", 5);
87 shouldBeCloseTo("newImage.data[22]", "image.data[22]", 5); 96 shouldBeCloseTo("newImage.data[22]", "image.data[22]", 5);
88 shouldBe("newImage.data[23]", "image.data[23]"); 97 shouldBe("newImage.data[23]", "image.data[23]");
89 finishJSTest(); 98 finishJSTest();
90 } 99 }
91 100
92 </script> 101 </script>
93 </body> 102 </body>
94 </html> 103 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/canvas-ImageBitmap-transferable-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698