diff options
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast')
9 files changed, 274 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-clip-rule-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-clip-rule-expected.txt new file mode 100644 index 0000000..eb71dc9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-clip-rule-expected.txt @@ -0,0 +1,27 @@ +Series of tests to ensure correct results of the winding rule. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +Testing default clip +PASS pixelDataAtPoint()[0] is within 5 of 0 +PASS pixelDataAtPoint()[1] is within 5 of 255 +PASS pixelDataAtPoint()[2] is within 5 of 0 +PASS pixelDataAtPoint()[3] is within 5 of 255 + +Testing nonzero clip +PASS pixelDataAtPoint()[0] is within 5 of 0 +PASS pixelDataAtPoint()[1] is within 5 of 255 +PASS pixelDataAtPoint()[2] is within 5 of 0 +PASS pixelDataAtPoint()[3] is within 5 of 255 + +Testing evenodd clip +PASS pixelDataAtPoint()[0] is within 5 of 255 +PASS pixelDataAtPoint()[1] is within 5 of 0 +PASS pixelDataAtPoint()[2] is within 5 of 0 +PASS pixelDataAtPoint()[3] is within 5 of 255 + +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-clip-rule.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-clip-rule.html new file mode 100644 index 0000000..af1b8f3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-clip-rule.html @@ -0,0 +1,9 @@ +<!doctype html> +<html> +<head> +<script src="../js/resources/js-test-pre.js"></script> +</head> +<body> +<script src="script-tests/canvas-clip-rule.js"></script> +<script src="../js/resources/js-test-post.js"></script> +</body>
\ No newline at end of file diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-fill-rule-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-fill-rule-expected.txt new file mode 100644 index 0000000..956e134 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-fill-rule-expected.txt @@ -0,0 +1,27 @@ +Series of tests to ensure correct results of the winding rule. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +Testing default fill +PASS pixelDataAtPoint()[0] is within 5 of 0 +PASS pixelDataAtPoint()[1] is within 5 of 255 +PASS pixelDataAtPoint()[2] is within 5 of 0 +PASS pixelDataAtPoint()[3] is within 5 of 255 + +Testing nonzero fill +PASS pixelDataAtPoint()[0] is within 5 of 0 +PASS pixelDataAtPoint()[1] is within 5 of 255 +PASS pixelDataAtPoint()[2] is within 5 of 0 +PASS pixelDataAtPoint()[3] is within 5 of 255 + +Testing evenodd fill +PASS pixelDataAtPoint()[0] is within 5 of 255 +PASS pixelDataAtPoint()[1] is within 5 of 0 +PASS pixelDataAtPoint()[2] is within 5 of 0 +PASS pixelDataAtPoint()[3] is within 5 of 255 + +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-fill-rule.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-fill-rule.html new file mode 100644 index 0000000..f7ae9db --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-fill-rule.html @@ -0,0 +1,9 @@ +<!doctype html> +<html> +<head> +<script src="../js/resources/js-test-pre.js"></script> +</head> +<body> +<script src="script-tests/canvas-fill-rule.js"></script> +<script src="../js/resources/js-test-post.js"></script> +</body>
\ No newline at end of file diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-isPointInPath-winding-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-isPointInPath-winding-expected.txt new file mode 100644 index 0000000..611e068 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-isPointInPath-winding-expected.txt @@ -0,0 +1,18 @@ +Series of tests to ensure correct results of the winding rule in isPointInPath. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +Testing default isPointInPath +PASS ctx.isPointInPath(50, 50) is true + +Testing nonzero isPointInPath +PASS ctx.isPointInPath(50, 50, 'nonzero') is true + +Testing evenodd isPointInPath +PASS ctx.isPointInPath(50, 50, 'evenodd') is false + +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-isPointInPath-winding.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-isPointInPath-winding.html new file mode 100644 index 0000000..0ae4d9a --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-isPointInPath-winding.html @@ -0,0 +1,9 @@ +<!doctype html> +<html> +<head> +<script src="../js/resources/js-test-pre.js"></script> +</head> +<body> +<script src="script-tests/canvas-isPointInPath-winding.js"></script> +<script src="../js/resources/js-test-post.js"></script> +</body>
\ No newline at end of file diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-clip-rule.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-clip-rule.js new file mode 100644 index 0000000..e6a45ed --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-clip-rule.js @@ -0,0 +1,69 @@ +description("Series of tests to ensure correct results of the winding rule."); + + +var tmpimg = document.createElement('canvas'); +tmpimg.width = 200; +tmpimg.height = 200; +ctx = tmpimg.getContext('2d'); + +// Create the image for blending test with images. +var img = document.createElement('canvas'); +img.width = 100; +img.height = 100; +var imgCtx = img.getContext('2d'); + +function pixelDataAtPoint() +{ + return ctx.getImageData(50, 50, 1, 1).data; +} + +function checkResult(expectedColors, sigma) { + for (var i = 0; i < 4; i++) + shouldBeCloseTo("pixelDataAtPoint()[" + i + "]", expectedColors[i], sigma); +} + +// Execute test. +function prepareTestScenario() { + debug('Testing default clip'); + ctx.fillStyle = 'rgb(255,0,0)'; + ctx.fillRect(0, 0, 100, 100); + ctx.fillStyle = 'rgb(0,255,0)'; + ctx.beginPath(); + ctx.rect(0, 0, 100, 100); + ctx.rect(25, 25, 50, 50); + ctx.clip(); + ctx.beginPath(); + ctx.fillRect(0, 0, 100, 100); + checkResult([0, 255, 0, 255], 5); + debug(''); + + debug('Testing nonzero clip'); + ctx.fillStyle = 'rgb(255,0,0)'; + ctx.fillRect(0, 0, 100, 100); + ctx.fillStyle = 'rgb(0,255,0)'; + ctx.beginPath(); + ctx.rect(0, 0, 100, 100); + ctx.rect(25, 25, 50, 50); + ctx.clip('nonzero'); + ctx.beginPath(); + ctx.fillRect(0, 0, 100, 100); + checkResult([0, 255, 0, 255], 5); + debug(''); + + debug('Testing evenodd clip'); + ctx.fillStyle = 'rgb(255,0,0)'; + ctx.fillRect(0, 0, 100, 100); + ctx.fillStyle = 'rgb(0,255,0)'; + ctx.beginPath(); + ctx.rect(0, 0, 100, 100); + ctx.rect(25, 25, 50, 50); + ctx.clip('evenodd'); + ctx.beginPath(); + ctx.fillRect(0, 0, 100, 100); + checkResult([255, 0, 0, 255], 5); + debug(''); + +} + +// Run test and allow variation of results. +prepareTestScenario(); diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-fill-rule.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-fill-rule.js new file mode 100644 index 0000000..482e03a --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-fill-rule.js @@ -0,0 +1,66 @@ +description("Series of tests to ensure correct results of the winding rule."); + + +var tmpimg = document.createElement('canvas'); +tmpimg.width = 200; +tmpimg.height = 200; +ctx = tmpimg.getContext('2d'); + +// Create the image for blending test with images. +var img = document.createElement('canvas'); +img.width = 100; +img.height = 100; +var imgCtx = img.getContext('2d'); + +function pixelDataAtPoint() +{ + return ctx.getImageData(50, 50, 1, 1).data; +} + +function checkResult(expectedColors, sigma) { + for (var i = 0; i < 4; i++) + shouldBeCloseTo("pixelDataAtPoint()[" + i + "]", expectedColors[i], sigma); +} + +// Execute test. +function prepareTestScenario() { + debug('Testing default fill'); + ctx.fillStyle = 'rgb(255,0,0)'; + ctx.beginPath(); + ctx.fillRect(0, 0, 100, 100); + ctx.fillStyle = 'rgb(0,255,0)'; + ctx.beginPath(); + ctx.rect(0, 0, 100, 100); + ctx.rect(25, 25, 50, 50); + ctx.fill(); + checkResult([0, 255, 0, 255], 5); + debug(''); + + debug('Testing nonzero fill'); + ctx.fillStyle = 'rgb(255,0,0)'; + ctx.beginPath(); + ctx.fillRect(0, 0, 100, 100); + ctx.fillStyle = 'rgb(0,255,0)'; + ctx.beginPath(); + ctx.rect(0, 0, 100, 100); + ctx.rect(25, 25, 50, 50); + ctx.fill('nonzero'); + checkResult([0, 255, 0, 255], 5); + debug(''); + + debug('Testing evenodd fill'); + ctx.fillStyle = 'rgb(255,0,0)'; + ctx.beginPath(); + ctx.fillRect(0, 0, 100, 100); + ctx.fillStyle = 'rgb(0,255,0)'; + ctx.beginPath(); + ctx.rect(0, 0, 100, 100); + ctx.rect(25, 25, 50, 50); + ctx.fill('evenodd'); + checkResult([255, 0, 0, 255], 5); + debug(''); + +} + +// Run test and allow variation of results. +prepareTestScenario(); diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-isPointInPath-winding.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-isPointInPath-winding.js new file mode 100644 index 0000000..30d0a46 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-isPointInPath-winding.js @@ -0,0 +1,40 @@ +description("Series of tests to ensure correct results of the winding rule in isPointInPath."); + + +var tmpimg = document.createElement('canvas'); +tmpimg.width = 200; +tmpimg.height = 200; +ctx = tmpimg.getContext('2d'); + +// Create the image for blending test with images. +var img = document.createElement('canvas'); +img.width = 100; +img.height = 100; +var imgCtx = img.getContext('2d'); + +// Execute test. +function prepareTestScenario() { + debug('Testing default isPointInPath'); + ctx.beginPath(); + ctx.rect(0, 0, 100, 100); + ctx.rect(25, 25, 50, 50); + shouldBeTrue("ctx.isPointInPath(50, 50)"); + debug(''); + + debug('Testing nonzero isPointInPath'); + ctx.beginPath(); + ctx.rect(0, 0, 100, 100); + ctx.rect(25, 25, 50, 50); + shouldBeTrue("ctx.isPointInPath(50, 50, 'nonzero')"); + debug(''); + + debug('Testing evenodd isPointInPath'); + ctx.beginPath(); + ctx.rect(0, 0, 100, 100); + ctx.rect(25, 25, 50, 50); + shouldBeFalse("ctx.isPointInPath(50, 50, 'evenodd')"); + debug(''); +} + +// Run test and allow variation of results. +prepareTestScenario(); |