OLD | NEW |
1 description("Ensure correct behavior of canvas with image shadow. A square with
a cut-out top-right corner should be displayed with solid shadow (top) and blur
shadow (bottom)."); | 1 description("Ensure correct behavior of canvas with image shadow. A square with
a cut-out top-right corner should be displayed with solid shadow (top) and blur
shadow (bottom)."); |
2 | 2 |
3 function print(message, color) | 3 function print(message, color) |
4 { | 4 { |
5 var paragraph = document.createElement("div"); | 5 var paragraph = document.createElement("div"); |
6 paragraph.appendChild(document.createTextNode(message)); | 6 paragraph.appendChild(document.createTextNode(message)); |
7 paragraph.style.fontFamily = "monospace"; | 7 paragraph.style.fontFamily = "monospace"; |
8 if (color) | 8 if (color) |
9 paragraph.style.color = color; | 9 paragraph.style.color = color; |
10 document.getElementById("console").appendChild(paragraph); | 10 document.getElementById("console").appendChild(paragraph); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 shouldBe('d[2]', '255'); | 126 shouldBe('d[2]', '255'); |
127 shouldNotBe('d[3]', '255'); | 127 shouldNotBe('d[3]', '255'); |
128 | 128 |
129 imageData = ctx.getImageData(300, 500, 1, 1); | 129 imageData = ctx.getImageData(300, 500, 1, 1); |
130 d = imageData.data; | 130 d = imageData.data; |
131 shouldBe('d[0]', '0'); | 131 shouldBe('d[0]', '0'); |
132 shouldBe('d[1]', '0'); | 132 shouldBe('d[1]', '0'); |
133 shouldBe('d[2]', '255'); | 133 shouldBe('d[2]', '255'); |
134 shouldNotBe('d[3]', '255'); | 134 shouldNotBe('d[3]', '255'); |
135 | 135 |
| 136 imageData = ctx.getImageData(476, 324, 1, 1); |
| 137 d = imageData.data; |
| 138 shouldBe('d[0]', '0'); |
| 139 shouldBe('d[1]', '0'); |
| 140 shouldBe('d[2]', '255'); |
| 141 shouldNotBe('d[3]', '255'); |
| 142 |
136 imageData = ctx.getImageData(400, 500, 1, 1); | 143 imageData = ctx.getImageData(400, 500, 1, 1); |
137 d = imageData.data; | 144 d = imageData.data; |
138 shouldBe('d[0]', '0'); | 145 shouldBe('d[0]', '0'); |
139 shouldBe('d[1]', '0'); | 146 shouldBe('d[1]', '0'); |
140 shouldBe('d[2]', '255'); | 147 shouldBe('d[2]', '255'); |
141 shouldNotBe('d[3]', '255'); | 148 shouldNotBe('d[3]', '255'); |
142 | 149 |
143 imageData = ctx.getImageData(400, 400, 1, 1); | 150 imageData = ctx.getImageData(400, 400, 1, 1); |
144 d = imageData.data; | 151 d = imageData.data; |
145 shouldBe('d[0]', '0'); | 152 shouldBe('d[0]', '0'); |
(...skipping 11 matching lines...) Expand all Loading... |
157 d = imageData.data; | 164 d = imageData.data; |
158 shouldBe('d[0]', '0'); | 165 shouldBe('d[0]', '0'); |
159 shouldBe('d[1]', '0'); | 166 shouldBe('d[1]', '0'); |
160 shouldBe('d[2]', '0'); | 167 shouldBe('d[2]', '0'); |
161 shouldBe('d[3]', '0'); | 168 shouldBe('d[3]', '0'); |
162 | 169 |
163 finishJSTest(); | 170 finishJSTest(); |
164 } | 171 } |
165 | 172 |
166 window.jsTestIsAsync = true; | 173 window.jsTestIsAsync = true; |
OLD | NEW |