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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/cross-origin-OffscreenCanvas2D-createPattern.html

Issue 1954533002: Implement wouldTaintOrigin and expose createPattern for OCRC2D on main thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: OCRC2D pattern is working fine in GPU; remove Failure mark in TestExpectations Created 4 years, 7 months 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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="/js-test-resources/js-test.js"></script>
5 <script>
6 description("The pattern created by OffscreenCanvas2D from cross-origin image mu st be tainted.");
7
8 function shouldBeTainted(pattern) {
9 var canvas = document.createElement("canvas");
10 canvas.width = 10;
11 canvas.height = 10;
12 var context = canvas.getContext("2d");
13 // Setting tainted pattern as fillStyle on HTMLCanvas will taint the canvas.
14 context.fillStyle = pattern;
15 context.fillRect(0, 0, canvas.width, canvas.height);
16 try {
17 var imageData = context.getImageData(0, 0, 10, 10);
18 testFailed("ImageBitmap is not tainted.");
19 } catch (e) {
20 testPassed("ImageBitmap is tainted. Threw error: " + e);
21 }
22 }
23
24 var image = document.createElement('img');
25 image.src = 'http://localhost:8080/security/resources/abe.png';
26 image.addEventListener('load', function() {
27 var offscreenCanvas = new OffscreenCanvas(10, 10);
28 var offscreenContext = offscreenCanvas.getContext("2d");
29 var pat = offscreenContext.createPattern(image, "no-repeat");
30 shouldBeTainted(pat);
31 });
32
33 </script>
34 </body>
35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698