| Index: third_party/WebKit/LayoutTests/http/tests/security/canvas-remote-read-remote-svg-image.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/security/canvas-remote-read-remote-svg-image.html b/third_party/WebKit/LayoutTests/http/tests/security/canvas-remote-read-remote-svg-image.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9cb00ebd1afc69d1eeb3c2c22c512d8eb2313716
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/security/canvas-remote-read-remote-svg-image.html
|
| @@ -0,0 +1,31 @@
|
| +<!doctype html>
|
| +<script src="/resources/testharness.js"></script>
|
| +<script src="/resources/testharnessreport.js"></script>
|
| +<body></body>
|
| +<script>
|
| +
|
| +async_test(function(t) {
|
| + var canvas = document.createElement("canvas");
|
| + canvas.width = canvas.height = 100;
|
| +
|
| + var svg = document.createElementNS('http://www.w3.org/2000/svg','svg');
|
| + var image = document.createElementNS("http://www.w3.org/2000/svg", "image");
|
| + svg.appendChild(image);
|
| + image.setAttribute('href',
|
| + 'http://localhost:8000/security/resources/red200x100.png');
|
| +
|
| + var ctx = canvas.getContext("2d");
|
| +
|
| + image.addEventListener('load', t.step_func_done(function() {
|
| + ctx.drawImage(image, 0, 0);
|
| +
|
| + assert_throws("SecurityError", function() {
|
| + var c = ctx.getImageData(0, 0, 1, 1);
|
| + }, "We are trying cross-origin getImageData");
|
| + }));
|
| +
|
| + document.body.appendChild(canvas);
|
| + document.body.appendChild(svg);
|
| +}, "Checks no cross-origin on tainted canvas due to SVG image");
|
| +
|
| +</script>
|
|
|