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

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

Issue 200923002: Post a microtask to load <img> elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix last test failure Created 6 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 side-by-side diff with in-line comments
Download patch
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
index d8d31f04d2a53b8f5b239c28446279e60eccfd94..02416fd36f618e53b637aee5639e03cafdf16a01 100644
--- a/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html
+++ b/LayoutTests/http/tests/security/cross-origin-createImageBitmap.html
@@ -8,19 +8,21 @@
window.jsTestIsAsync = true;
var img = document.createElement('img');
+ var vid = document.createElement('video');
+
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 \'Window\': Cross-origin access to the source image is denied."');
+ img.addEventListener('load', function () {
+ shouldThrow('createImageBitmap(img, 0, 0, 10, 10)', '"SecurityError: Failed to execute \'createImageBitmap\' on \'Window\': 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 \'Window\': Cross-origin access to the source video is denied."');
- finishJSTest();
+ 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 \'Window\': Cross-origin access to the source video is denied."');
+ finishJSTest();
+ });
+ document.body.appendChild(vid);
+ vid.play();
});
- document.body.appendChild(vid);
- vid.play();
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698