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

Unified 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: add validateImageBitmap helper function & a layout test 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/security/webgl-cross-origin-ImageBitmap-blocked.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/webgl-cross-origin-ImageBitmap-blocked.html b/third_party/WebKit/LayoutTests/http/tests/security/webgl-cross-origin-ImageBitmap-blocked.html
new file mode 100644
index 0000000000000000000000000000000000000000..1f64c6e97923fac5ef036babadfeea85d89f6223
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/webgl-cross-origin-ImageBitmap-blocked.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="/js-test-resources/js-test.js"></script>
+<script>
+description("WebGL's texImage2D should throw security error when the ImageBitmap is not origin clean.");
Justin Novosad 2016/01/11 21:08:53 Nit: "throw security error" -> "throw a SecurityEr
xidachen 2016/01/12 02:35:50 Acknowledged.
+
+window.jsTestIsAsync = true;
+var gl;
+var bitmap;
+
+var image = document.createElement('img');
+image.src = 'http://localhost:8080/security/resources/abe.png';
+
+image.addEventListener('load', function() {
+ var canvas = document.createElement("canvas");
+ canvas.width = 10;
+ canvas.height = 10;
+
+ gl = canvas.getContext("webgl");
+ createImageBitmap(image, 0, 0, 10, 10).then(imageBitmap => {
+ bitmap = imageBitmap;
+ shouldThrow("gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, bitmap)");
Justin Novosad 2016/01/11 21:08:53 I think you should make a call to texImage2D that
xidachen 2016/01/12 02:35:50 Acknowledged.
+ finishJSTest();
+ }, () => {
+ testFailed("Unexpected failure");
+ finishJSTest();
+ });
+});
+</script>
+</body>
+</html>
« 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