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

Unified Diff: LayoutTests/media/video-canvas-draw.html

Issue 181693006: Refactoring source image usage in CanvasRenderingContext2D (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: applied last corrections Created 6 years, 9 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/media/video-canvas-draw.html
diff --git a/LayoutTests/media/video-canvas-draw.html b/LayoutTests/media/video-canvas-draw.html
new file mode 100644
index 0000000000000000000000000000000000000000..1bf7227d6ce41e2baa3cc29caa6937c036ab9574
--- /dev/null
+++ b/LayoutTests/media/video-canvas-draw.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="media-file.js"></script>
+<script>
+
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+}
+
+function onLoad() {
+ var video = document.getElementsByTagName('video')[0];
+ video.src = findMediaFile("video", "content/test");
+
+ var canvas1 = document.getElementById('canvas1');
+ var canvas2 = document.getElementById('canvas2');
+ var ctx1 = canvas1.getContext('2d');
+ var ctx2 = canvas2.getContext('2d');
+
+ video.load();
+ video.addEventListener("canplay", function (e) {
+ ctx1.fillStyle = ctx1.createPattern(video, 'repeat');
+ ctx1.fillRect(0, 0, 320, 240);
+
+ ctx2.drawImage(video, 0, 0);
+
+ if (window.testRunner) {
+ testRunner.notifyDone();
+ }
+ });
+}
+
+</script>
+</head>
+<body onload="onLoad();">
+ Test to verify that drawing a video to a 2D canvas with drawImage and with a CanvasPattern works as expected.
+ <video></video>
+ <canvas id="canvas1" width="320px" height="240px"></canvas>
+ <canvas id="canvas2" width="320px" height="240px"></canvas>
+</body>
+</html>
« no previous file with comments | « LayoutTests/inspector/profiler/canvas2d/canvas2d-api-changes.html ('k') | LayoutTests/media/video-canvas-draw-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698