| OLD | NEW |
| 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 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script> | 7 <script> |
| 8 | 8 |
| 9 description("Ensure correct behavior of drawImage with ImageBitmaps along with f
lipY option."); | 9 description("Ensure correct behavior of drawImage with ImageBitmaps along with f
lipY option."); |
| 10 window.jsTestIsAsync = true; | 10 window.jsTestIsAsync = true; |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 shouldBeRed(9, 9); | 242 shouldBeRed(9, 9); |
| 243 shouldBeGreen(11, 9); | 243 shouldBeGreen(11, 9); |
| 244 shouldBeBlue(9, 11); | 244 shouldBeBlue(9, 11); |
| 245 shouldBeBlack(11, 11); | 245 shouldBeBlack(11, 11); |
| 246 shouldBeBlack(19, 19); | 246 shouldBeBlack(19, 19); |
| 247 shouldBeClear(1, 21); | 247 shouldBeClear(1, 21); |
| 248 shouldBeClear(21, 1); | 248 shouldBeClear(21, 1); |
| 249 shouldBeClear(21, 21); | 249 shouldBeClear(21, 21); |
| 250 } | 250 } |
| 251 | 251 |
| 252 /*commenting out these cases because of crbug.com/578889 |
| 252 clearContext(ctx); | 253 clearContext(ctx); |
| 253 ctx.drawImage(imageBitmap, 0, 0, 10, 10); | 254 ctx.drawImage(imageBitmap, 0, 0, 10, 10); |
| 254 if (option == "flipY" || option == "bottomLeft") { | 255 if (option == "flipY" || option == "bottomLeft") { |
| 255 shouldBeBlue(4, 4); | 256 shouldBeBlue(4, 4); |
| 256 shouldBeBlack(6, 4); | 257 shouldBeBlack(6, 4); |
| 257 shouldBeRed(4, 6); | 258 shouldBeRed(4, 6); |
| 258 shouldBeGreen(6, 6); | 259 shouldBeGreen(6, 6); |
| 259 shouldBeGreen(9, 9); | 260 shouldBeGreen(9, 9); |
| 260 shouldBeClear(1, 11); | 261 shouldBeClear(1, 11); |
| 261 shouldBeClear(11, 1); | 262 shouldBeClear(11, 1); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 shouldBeClear(1, 21); | 303 shouldBeClear(1, 21); |
| 303 shouldBeClear(21, 1); | 304 shouldBeClear(21, 1); |
| 304 shouldBeClear(21, 21); | 305 shouldBeClear(21, 21); |
| 305 } else { | 306 } else { |
| 306 shouldBeClear(9, 9); | 307 shouldBeClear(9, 9); |
| 307 shouldBeBlack(11, 11); | 308 shouldBeBlack(11, 11); |
| 308 shouldBeBlack(19, 19); | 309 shouldBeBlack(19, 19); |
| 309 shouldBeClear(1, 21); | 310 shouldBeClear(1, 21); |
| 310 shouldBeClear(21, 1); | 311 shouldBeClear(21, 1); |
| 311 shouldBeClear(21, 21); | 312 shouldBeClear(21, 21); |
| 312 } | 313 }*/ |
| 313 } | 314 } |
| 314 | 315 |
| 315 function checkCrop(imageBitmap, option) { | 316 function checkCrop(imageBitmap, option) { |
| 316 debug("Check crop."); | 317 debug("Check crop."); |
| 317 bitmap = imageBitmap; | 318 bitmap = imageBitmap; |
| 318 shouldBeType("bitmap", "ImageBitmap"); | 319 shouldBeType("bitmap", "ImageBitmap"); |
| 319 shouldBe("bitmap.width", "10"); | 320 shouldBe("bitmap.width", "10"); |
| 320 shouldBe("bitmap.height", "10"); | 321 shouldBe("bitmap.height", "10"); |
| 321 | 322 |
| 322 clearContext(ctx); | 323 clearContext(ctx); |
| 323 ctx.drawImage(imageBitmap, 0, 0); | 324 ctx.drawImage(imageBitmap, 0, 0); |
| 324 if (option == "flipY" || option == "bottomLeft") { | 325 if (option == "flipY" || option == "bottomLeft") { |
| 325 shouldBeRed(1, 1); | 326 shouldBeRed(1, 1); |
| 326 shouldBeRed(9, 9); | 327 shouldBeRed(9, 9); |
| 327 shouldBeClear(12, 12); | 328 shouldBeClear(12, 12); |
| 328 shouldBeClear(1, 12); | 329 shouldBeClear(1, 12); |
| 329 shouldBeClear(12, 1); | 330 shouldBeClear(12, 1); |
| 330 } else { | 331 } else { |
| 331 shouldBeRed(1, 1); | 332 shouldBeRed(1, 1); |
| 332 shouldBeRed(9, 9); | 333 shouldBeRed(9, 9); |
| 333 shouldBeClear(12, 12); | 334 shouldBeClear(12, 12); |
| 334 shouldBeClear(1, 12); | 335 shouldBeClear(1, 12); |
| 335 shouldBeClear(12, 1); | 336 shouldBeClear(12, 1); |
| 336 } | 337 } |
| 337 | 338 |
| 339 /*commenting out these cases because of crbug.com/578889 |
| 338 clearContext(ctx); | 340 clearContext(ctx); |
| 339 ctx.drawImage(imageBitmap, 0, 0, 20, 20); | 341 ctx.drawImage(imageBitmap, 0, 0, 20, 20); |
| 340 if (option == "flipY" || option == "bottomLeft") { | 342 if (option == "flipY" || option == "bottomLeft") { |
| 341 shouldBeRed(1, 1); | 343 shouldBeRed(1, 1); |
| 342 shouldBeRed(18, 18); | 344 shouldBeRed(18, 18); |
| 343 shouldBeClear(22, 22); | 345 shouldBeClear(22, 22); |
| 344 shouldBeClear(1, 22); | 346 shouldBeClear(1, 22); |
| 345 shouldBeClear(22, 1); | 347 shouldBeClear(22, 1); |
| 346 } else { | 348 } else { |
| 347 shouldBeRed(1, 1); | 349 shouldBeRed(1, 1); |
| 348 shouldBeRed(18, 18); | 350 shouldBeRed(18, 18); |
| 349 shouldBeClear(22, 22); | 351 shouldBeClear(22, 22); |
| 350 shouldBeClear(1, 22); | 352 shouldBeClear(1, 22); |
| 351 shouldBeClear(22, 1); | 353 shouldBeClear(22, 1); |
| 352 } | 354 }*/ |
| 353 } | 355 } |
| 354 | 356 |
| 355 function checkCropCenter(imageBitmap, option) { | 357 function checkCropCenter(imageBitmap, option) { |
| 356 debug("Check crop center."); | 358 debug("Check crop center."); |
| 357 bitmap = imageBitmap; | 359 bitmap = imageBitmap; |
| 358 shouldBeType("bitmap", "ImageBitmap"); | 360 shouldBeType("bitmap", "ImageBitmap"); |
| 359 shouldBe("bitmap.width", "10"); | 361 shouldBe("bitmap.width", "10"); |
| 360 shouldBe("bitmap.height", "10"); | 362 shouldBe("bitmap.height", "10"); |
| 361 | 363 |
| 362 clearContext(ctx); | 364 clearContext(ctx); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 374 shouldBeRed(4, 4); | 376 shouldBeRed(4, 4); |
| 375 shouldBeGreen(6, 4); | 377 shouldBeGreen(6, 4); |
| 376 shouldBeBlue(4, 6); | 378 shouldBeBlue(4, 6); |
| 377 shouldBeBlack(6, 6); | 379 shouldBeBlack(6, 6); |
| 378 shouldBeBlack(9, 9); | 380 shouldBeBlack(9, 9); |
| 379 shouldBeClear(11, 11); | 381 shouldBeClear(11, 11); |
| 380 shouldBeClear(1, 11); | 382 shouldBeClear(1, 11); |
| 381 shouldBeClear(11, 1); | 383 shouldBeClear(11, 1); |
| 382 } | 384 } |
| 383 | 385 |
| 386 /*commenting out these cases because of crbug.com/578889 |
| 384 clearContext(ctx); | 387 clearContext(ctx); |
| 385 ctx.drawImage(imageBitmap, 0, 0, 20, 20); | 388 ctx.drawImage(imageBitmap, 0, 0, 20, 20); |
| 386 if (option == "flipY" || option == "bottomLeft") { | 389 if (option == "flipY" || option == "bottomLeft") { |
| 387 shouldBeBlue(8, 8); | 390 shouldBeBlue(8, 8); |
| 388 shouldBeBlack(11, 8); | 391 shouldBeBlack(11, 8); |
| 389 shouldBeRed(8, 11); | 392 shouldBeRed(8, 11); |
| 390 shouldBeGreen(11, 11); | 393 shouldBeGreen(11, 11); |
| 391 shouldBeGreen(18, 18); | 394 shouldBeGreen(18, 18); |
| 392 shouldBeClear(22, 22); | 395 shouldBeClear(22, 22); |
| 393 shouldBeClear(1, 21); | 396 shouldBeClear(1, 21); |
| 394 shouldBeClear(21, 1); | 397 shouldBeClear(21, 1); |
| 395 } else { | 398 } else { |
| 396 shouldBeRed(8, 8); | 399 shouldBeRed(8, 8); |
| 397 shouldBeGreen(11, 8); | 400 shouldBeGreen(11, 8); |
| 398 shouldBeBlue(8, 11); | 401 shouldBeBlue(8, 11); |
| 399 shouldBeBlack(11, 11); | 402 shouldBeBlack(11, 11); |
| 400 shouldBeBlack(18, 18); | 403 shouldBeBlack(18, 18); |
| 401 shouldBeClear(22, 22); | 404 shouldBeClear(22, 22); |
| 402 shouldBeClear(1, 21); | 405 shouldBeClear(1, 21); |
| 403 shouldBeClear(21, 1); | 406 shouldBeClear(21, 1); |
| 404 } | 407 }*/ |
| 405 } | 408 } |
| 406 | 409 |
| 407 function checkCropRight(imageBitmap, option) { | 410 function checkCropRight(imageBitmap, option) { |
| 408 debug("Check crop right."); | 411 debug("Check crop right."); |
| 409 bitmap = imageBitmap; | 412 bitmap = imageBitmap; |
| 410 shouldBeType("bitmap", "ImageBitmap"); | 413 shouldBeType("bitmap", "ImageBitmap"); |
| 411 shouldBe("bitmap.width", "10"); | 414 shouldBe("bitmap.width", "10"); |
| 412 shouldBe("bitmap.height", "10"); | 415 shouldBe("bitmap.height", "10"); |
| 413 | 416 |
| 414 clearContext(ctx); | 417 clearContext(ctx); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 clearContext(ctx); | 568 clearContext(ctx); |
| 566 ctx.drawImage(imageBitmap, 0, 0); | 569 ctx.drawImage(imageBitmap, 0, 0); |
| 567 shouldBeClear(1, 1); | 570 shouldBeClear(1, 1); |
| 568 shouldBeClear(9, 9); | 571 shouldBeClear(9, 9); |
| 569 shouldBeClear(11, 11); | 572 shouldBeClear(11, 11); |
| 570 shouldBeClear(22, 22); | 573 shouldBeClear(22, 22); |
| 571 } | 574 } |
| 572 </script> | 575 </script> |
| 573 </body> | 576 </body> |
| 574 </html> | 577 </html> |
| OLD | NEW |