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

Side by Side Diff: LayoutTests/fast/canvas/canvas-lineDash-input-sequence.html

Issue 555133003: Use ExceptionState to throw exceptions when converting arrays (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 6 years, 3 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
OLDNEW
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <link rel="help" href="http://www.w3.org/TR/2013/WD-2dcontext2-20130528/#dom-con text-2d-setlinedash"> 4 <link rel="help" href="http://www.w3.org/TR/2013/WD-2dcontext2-20130528/#dom-con text-2d-setlinedash">
5 <script src="../../resources/js-test.js"></script> 5 <script src="../../resources/js-test.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <script> 8 <script>
9 description("Test that setLineDash converts input argument into a Web IDL sequen ce"); 9 description("Test that setLineDash converts input argument into a Web IDL sequen ce");
10 10
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 32
33 var lineDash; 33 var lineDash;
34 var inputArray; 34 var inputArray;
35 function checkLineDash(testArray, shouldFail) { 35 function checkLineDash(testArray, shouldFail) {
36 inputArray = testArray; 36 inputArray = testArray;
37 // Reset line dash. 37 // Reset line dash.
38 ctx.setLineDash([]); 38 ctx.setLineDash([]);
39 // Set line dash. 39 // Set line dash.
40 if (shouldFail) { 40 if (shouldFail) {
41 shouldThrow("ctx.setLineDash(inputArray)", "'TypeError: The 1st argument is neither an array, nor does it have indexed properties.'"); 41 shouldThrow("ctx.setLineDash(inputArray)", "'TypeError: Failed to execut e \\'setLineDash\\' on \\'CanvasRenderingContext2D\\': The 1st argument is neith er an array, nor does it have indexed properties.'");
42 } else { 42 } else {
43 ctx.setLineDash(inputArray); 43 ctx.setLineDash(inputArray);
44 lineDash = ctx.getLineDash(); 44 lineDash = ctx.getLineDash();
45 for (var i = 0; i < arrayValues.length; ++i) 45 for (var i = 0; i < arrayValues.length; ++i)
46 shouldBe("lineDash[" + i + "]", "" + arrayValues[i]); 46 shouldBe("lineDash[" + i + "]", "" + arrayValues[i]);
47 } 47 }
48 } 48 }
49 49
50 var arrayTypes = [Array, Int8Array, Int16Array, Int32Array, Uint8Array, Uint16Ar ray, Uint32Array, Float32Array, Float64Array, Uint8ClampedArray, Object]; 50 var arrayTypes = [Array, Int8Array, Int16Array, Int32Array, Uint8Array, Uint16Ar ray, Uint32Array, Float32Array, Float64Array, Uint8ClampedArray, Object];
51 51
(...skipping 16 matching lines...) Expand all
68 checkLineDash("Test", true); 68 checkLineDash("Test", true);
69 debug("* Test passing a Boolean as input."); 69 debug("* Test passing a Boolean as input.");
70 checkLineDash(true, true); 70 checkLineDash(true, true);
71 debug("* Test passing null as input."); 71 debug("* Test passing null as input.");
72 checkLineDash(null, true); 72 checkLineDash(null, true);
73 debug("* Test passing undefined as input."); 73 debug("* Test passing undefined as input.");
74 checkLineDash(undefined, true); 74 checkLineDash(undefined, true);
75 </script> 75 </script>
76 </body> 76 </body>
77 </html> 77 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698