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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-zero-size-readback.html

Issue 2539333003: Fix crash when calling convertToBlob on an OffscreenCanvas with no pixels (Closed)
Patch Set: remove tab characters 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/core/offscreencanvas/OffscreenCanvas.cpp » ('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 promise_test(
6 t => { return zeroSizeReadback("width", "none", t); },
7 "Verify convertToBlob on a 0 width OffscreenCanvas with no context."
8 );
9
10 promise_test(
11 t => { return zeroSizeReadback("width", "2d", t); },
12 "Verify convertToBlob and getImageData on a 0 width OffscreenCanvas with a 2d context."
13 );
14
15 promise_test(
16 t => { return zeroSizeReadback("width", "webgl", t); },
17 "Verify convertToBlob on a 0 width OffscreenCanvas with a webgl context."
18 );
19
20 promise_test(
21 t => { return zeroSizeReadback("width", "webgl2", t); },
22 "Verify convertToBlob on a 0 width OffscreenCanvas with a webgl2 context."
23 );
24
25 promise_test(
26 t => { return zeroSizeReadback("height", "none", t); },
27 "Verify convertToBlob on a 0 height OffscreenCanvas with no context."
28 );
29
30 promise_test(
31 t => { return zeroSizeReadback("height", "2d", t); },
32 "Verify convertToBlob and getImageData on a 0 height OffscreenCanvas with a 2d context."
33 );
34
35 promise_test(
36 t => { return zeroSizeReadback("height", "webgl", t); },
37 "Verify convertToBlob on a 0 height OffscreenCanvas with a webgl context."
38 );
39
40 promise_test(
41 t => { return zeroSizeReadback("height", "webgl2", t); },
42 "Verify convertToBlob on a 0 height OffscreenCanvas with a webgl2 context."
43 );
44
45 function zeroSizeReadback(zeroDimension, contextType, t) {
46 var offscreen = new OffscreenCanvas(10, 10);
47 eval("offscreen." + zeroDimension + " = 0");
48 // Verify that one of the dimensions was indeed zeroed.
49 assert_equals(offscreen.width * offscreen.height, 0);
50
51 var ctx;
52 if (contextType != "none") {
53 ctx = offscreen.getContext(contextType);
54 }
55
56 if (contextType == '2d') {
57 var imgdata = ctx.getImageData(0, 0, 1, 1);
58 assert_equals(imgdata.width, 1);
59 assert_equals(imgdata.height, 1);
60 }
61
62 return promise_rejects(t, new DOMException('', 'IndexSizeError'), offscreen.co nvertToBlob());
63 }
64 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698