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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/webgl-cross-origin-ImageBitmap-blocked.html

Issue 1573173002: Make WebGL's texImage2D and texSubImage2D handle cross-origin ImageBitmap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layout tests includes both origin-clean and tainted-origin imagebitmap Created 4 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/webgl-cross-origin-ImageBitmap-blocked-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="/js-test-resources/js-test.js"></script>
5 <script>
6 description("WebGL's tex(Sub)Image2D should throw a SecurityError exception when the ImageBitmap is not origin clean.");
7
8 window.jsTestIsAsync = true;
9 var gl;
10 var bitmap;
11
12 var image = document.createElement('img');
13 image.src = 'http://localhost:8080/security/resources/abe.png';
14
15 image.addEventListener('load', function() {
16 var canvas = document.createElement("canvas");
17 canvas.width = 10;
18 canvas.height = 10;
19
20 // ImageBitmap created from a clean canvas should be origin clean
21 createImageBitmap(canvas, 0, 0, 10, 10).then(imageBitmap => {
22 bitmap = imageBitmap;
23 shouldNotThrow("gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNS IGNED_BYTE, bitmap)");
Ken Russell (switch to Gerrit) 2016/01/12 05:03:22 Follow this up with shouldBe("gl.getError()", "gl.
xidachen 2016/01/12 13:58:37 Acknowledged.
24 shouldNotThrow("gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNS IGNED_BYTE, bitmap)");
Ken Russell (switch to Gerrit) 2016/01/12 05:03:22 Same here.
xidachen 2016/01/12 13:58:37 Acknowledged.
25 }, () => {
26 testFailed("Unexpected failure");
27 finishJSTest();
28 });
29
30 // Testing tainted ImageBitmap
31 gl = canvas.getContext("webgl");
Ken Russell (switch to Gerrit) 2016/01/12 05:03:22 You should create a texture object and bind it to
xidachen 2016/01/12 13:58:37 Acknowledged.
32 createImageBitmap(image, 0, 0, 10, 10).then(imageBitmap => {
33 bitmap = imageBitmap;
34 shouldThrow("gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGN ED_BYTE, bitmap)");
Ken Russell (switch to Gerrit) 2016/01/12 05:03:22 Follow this up with shouldBe("gl.getError()", "gl.
xidachen 2016/01/12 13:58:37 Acknowledged.
35 shouldThrow("gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGN ED_BYTE, bitmap)");
Ken Russell (switch to Gerrit) 2016/01/12 05:03:22 Same here.
xidachen 2016/01/12 13:58:37 Acknowledged.
36 finishJSTest();
37 }, () => {
38 testFailed("Unexpected failure");
39 finishJSTest();
40 });
Ken Russell (switch to Gerrit) 2016/01/12 05:03:22 Shouldn't this entire second createImageBitmap cal
xidachen 2016/01/12 13:58:37 Acknowledged.
41 });
42 </script>
43 </body>
44 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/webgl-cross-origin-ImageBitmap-blocked-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698