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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-setMatrixValue.html

Issue 2516973002: [GeometryInferface] add Constructor(DOMString transformList). (Closed)
Patch Set: [GeometryInferface] add Constructor(DOMString transformList). 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
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="./resources/geometry-interfaces-test-helpers.js"></script> 4 <script src="./resources/geometry-interfaces-test-helpers.js"></script>
5 <script> 5 <script>
6 6
7 var matrix2d = [5, 4, 11, 34, 55, 11]; 7 var matrix2d = [5, 4, 11, 34, 55, 11];
8 var matrix3d = [5, 11, 55, 77, 44, 33, 55, 75, 88, 99, 12, 43, 65, 36, 85, 25]; 8 var matrix3d = [5, 11, 55, 77, 44, 33, 55, 75, 88, 99, 12, 43, 65, 36, 85, 25];
9 9
10 test(() => { 10 test(() => {
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // assert_matrix_almost_equals(actualMatrix2, expectedMatrix); 231 // assert_matrix_almost_equals(actualMatrix2, expectedMatrix);
232 // }, "DOMMatrix setMatrix(multiple value)"); 232 // }, "DOMMatrix setMatrix(multiple value)");
233 233
234 test(() => { 234 test(() => {
235 235
236 var actualMatrix = new DOMMatrix([1, 2, 3, 4, 5, 6]); 236 var actualMatrix = new DOMMatrix([1, 2, 3, 4, 5, 6]);
237 var expectedMatrix = new DOMMatrix([1, 2, 3, 4, 5, 6]); 237 var expectedMatrix = new DOMMatrix([1, 2, 3, 4, 5, 6]);
238 238
239 assert_throws(new SyntaxError(), () => { 239 assert_throws(new SyntaxError(), () => {
240 actualMatrix.setMatrixValue("initial"); 240 actualMatrix.setMatrixValue("initial");
241 }, "CSS-wide keywords are disallowed."); 241 }, "CSS-wide keywords are disallowed");
242 242
243 assert_throws(new SyntaxError(), () => { 243 assert_throws(new SyntaxError(), () => {
244 actualMatrix.setMatrixValue("notExistFunction()"); 244 actualMatrix.setMatrixValue("notExistFunction()");
245 }, "can't parse not exist function."); 245 }, "can't parse not exist function");
246 246
247 assert_throws(new SyntaxError(), () => { 247 assert_throws(new SyntaxError(), () => {
248 actualMatrix.setMatrixValue("translateY(50%)"); 248 actualMatrix.setMatrixValue("translateY(50%)");
249 }, "Can't parse without absolute unit."); 249 }, "using relative units should throw a SyntaxError");
250 250
251 assert_throws(new SyntaxError(), () => { 251 assert_throws(new SyntaxError(), () => {
252 actualMatrix.setMatrixValue("translateX(1.2em)"); 252 actualMatrix.setMatrixValue("translateX(1.2em)");
253 }, "Can't parse without absolute unit."); 253 }, "using relative units should throw a SyntaxError");
254 254
255 assert_throws(new SyntaxError(), () => { 255 assert_throws(new SyntaxError(), () => {
256 actualMatrix.setMatrixValue("translateX(10ex)"); 256 actualMatrix.setMatrixValue("translateX(10ex)");
257 }, "Can't parse without absolute unit."); 257 }, "using relative units should throw a SyntaxError");
258 258
259 assert_throws(new SyntaxError(), () => { 259 assert_throws(new SyntaxError(), () => {
260 actualMatrix.setMatrixValue("translateX(10ch)"); 260 actualMatrix.setMatrixValue("translateX(10ch)");
261 }, "Can't parse without absolute unit."); 261 }, "using relative units should throw a SyntaxError");
262 262
263 assert_throws(new SyntaxError(), () => { 263 assert_throws(new SyntaxError(), () => {
264 actualMatrix.setMatrixValue("translateX(10rem)"); 264 actualMatrix.setMatrixValue("translateX(10rem)");
265 }, "Can't parse without absolute unit."); 265 }, "using relative units should throw a SyntaxError");
266 266
267 assert_throws(new SyntaxError(), () => { 267 assert_throws(new SyntaxError(), () => {
268 actualMatrix.setMatrixValue("translateX(10vw)"); 268 actualMatrix.setMatrixValue("translateX(10vw)");
269 }, "Can't parse without absolute unit."); 269 }, "using relative units should throw a SyntaxError");
270 270
271 assert_throws(new SyntaxError(), () => { 271 assert_throws(new SyntaxError(), () => {
272 actualMatrix.setMatrixValue("translateX(10vh)"); 272 actualMatrix.setMatrixValue("translateX(10vh)");
273 }, "Can't parse without absolute unit."); 273 }, "using relative units should throw a SyntaxError");
274 274
275 assert_throws(new SyntaxError(), () => { 275 assert_throws(new SyntaxError(), () => {
276 actualMatrix.setMatrixValue("translateX(10vmin)"); 276 actualMatrix.setMatrixValue("translateX(10vmin)");
277 }, "Can't parse without absolute unit."); 277 }, "using relative units should throw a SyntaxError");
278 278
279 assert_throws(new SyntaxError(), () => { 279 assert_throws(new SyntaxError(), () => {
280 actualMatrix.setMatrixValue("translateX(10vmax)"); 280 actualMatrix.setMatrixValue("translateX(10vmax)");
281 }, "Can't parse without absolute unit."); 281 }, "using relative units should throw a SyntaxError");
282 282
283 assert_throws(new SyntaxError(), () => { 283 assert_throws(new SyntaxError(), () => {
284 actualMatrix.setMatrixValue("translateX(calc(10px + 1em))"); 284 actualMatrix.setMatrixValue("translateX(calc(10px + 1em))");
285 }, "Can't parse without absolute unit."); 285 }, "using relative units should throw a SyntaxError");
286 286
287 //actualMatrix should be not changed. 287 //actualMatrix should be not changed.
288 assert_true(actualMatrix.is2D); 288 assert_true(actualMatrix.is2D);
289 assert_matrix_almost_equals(actualMatrix, expectedMatrix); 289 assert_matrix_almost_equals(actualMatrix, expectedMatrix);
290 290
291 }, "DOMMatrix.setMatrix(): Exception test."); 291 }, "DOMMatrix.setMatrix(): Exception test");
292 292
293 </script> 293 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698