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

Unified Diff: LayoutTests/http/tests/security/cross-origin-createImageBitmap.html

Issue 23548041: Improve createImageBitmap SecurityError exception messages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: test Created 7 years, 3 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 | LayoutTests/http/tests/security/cross-origin-createImageBitmap-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/security/cross-origin-createImageBitmap.html
diff --git a/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html b/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html
new file mode 100644
index 0000000000000000000000000000000000000000..790f6c6cbd6fc9b3904341b89a2d09831905a450
--- /dev/null
+++ b/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <script src="/js-test-resources/js-test-pre.js"></script>
+ <script>
+ description("The image bitmap factories should throw exceptions on cross-origin access.");
+
+ window.jsTestIsAsync = true;
+
+ var img = document.createElement('img');
+ document.body.appendChild(img);
+ img.src = 'http://localhost:8080/security/resources/abe.png';
+
+ shouldThrow('createImageBitmap(img, 0, 0, 10, 10)', '"SecurityError: Failed to execute \'createImageBitmap\' on \'ImageBitmapFactories\': cross-origin access to the source image is denied."');
+
+ var vid = document.createElement('video');
+ vid.src = 'http://localhost:8080/media/resources/load-video.php?name=test.ogv&amp;type=video/ogv';
+ vid.addEventListener('playing', function () {
+ shouldThrow('createImageBitmap(vid, 0, 0, 10, 10)', '"SecurityError: Failed to execute \'createImageBitmap\' on \'ImageBitmapFactories\': cross-origin access to the source video is denied."');
+ finishJSTest();
+ });
+ document.body.appendChild(vid);
+ vid.play();
+ </script>
+ <script src="/js-test-resources/js-test-post.js"></script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/cross-origin-createImageBitmap-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698