 Chromium Code Reviews
 Chromium Code Reviews Issue 2693193003:
  Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests.  (Closed)
    
  
    Issue 2693193003:
  Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests.  (Closed) 
  | Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-state-intact-after-putImageData.html | 
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-state-intact-after-putImageData.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-state-intact-after-putImageData.html | 
| index 7c555c08459f82eaa8f484119fdc836bb10be524..f1f25d469d25641b1fd63f001dc425e170588c43 100644 | 
| --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-state-intact-after-putImageData.html | 
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-state-intact-after-putImageData.html | 
| @@ -1,9 +1,28 @@ | 
| -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 
| -<html> | 
| -<head> | 
| -<script src="../../resources/js-test.js"></script> | 
| -</head> | 
| -<body> | 
| -<script src="script-tests/canvas-state-intact-after-putImageData.js"></script> | 
| -</body> | 
| -</html> | 
| +<script src="../../resources/testharness.js"></script> | 
| +<script src="../../resources/testharnessreport.js"></script> | 
| + | 
| +<script> | 
| +test(function(t) { | 
| + | 
| +var ctx = document.createElement('canvas').getContext('2d'); | 
| 
Justin Novosad
2017/02/21 21:53:35
indent
 
zakerinasab
2017/02/22 15:33:54
Done.
 | 
| + | 
| +ctx.fillStyle = 'red'; | 
| +ctx.fillRect(0, 0, 1, 1); | 
| + | 
| +assert_equals(ctx.fillStyle, '#ff0000'); | 
| +var imageData = ctx.getImageData(0, 0, 2, 1); | 
| +assert_array_equals(imageData.data.slice(0,4), [255, 0, 0, 255]); | 
| +assert_array_equals(imageData.data.slice(4), [0, 0, 0, 0]); | 
| + | 
| +ctx.putImageData(imageData, 1, 1); | 
| +imageData = ctx.getImageData(1, 1, 1, 1); | 
| +assert_array_equals(imageData.data, [255, 0, 0, 255]); | 
| + | 
| +assert_equals(ctx.fillStyle, '#ff0000'); | 
| + | 
| +ctx.fillRect(2, 2, 1, 1); | 
| +data = ctx.getImageData(2, 2, 1, 1).data; | 
| +assert_array_equals(data, [255, 0, 0, 255]); | 
| + | 
| +}, "Test that the rendering context state is intact after a call to putImageData()"); | 
| +</script> |