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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas-experimental/webgl/texImage-video-last-uploaded-metadata.html

Issue 2749653003: Prototype HTMLVideoElement properties for WebGL texImage2D (Closed)
Patch Set: rebase Created 3 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: third_party/WebKit/LayoutTests/fast/canvas-experimental/webgl/texImage-video-last-uploaded-metadata.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas-experimental/webgl/texImage-video-last-uploaded-metadata.html b/third_party/WebKit/LayoutTests/fast/canvas-experimental/webgl/texImage-video-last-uploaded-metadata.html
new file mode 100644
index 0000000000000000000000000000000000000000..75e377ce4d477e49760c9506177f5cceb1f1ed7c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas-experimental/webgl/texImage-video-last-uploaded-metadata.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../canvas/webgl/resources/webgl-test-utils-full.js"></script>
+<script src="../../canvas/webgl/resources/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../resources/js-test.js"></script>
+<script>
+
+window.jsTestIsAsync = true;
+
+var wtu = WebGLTestUtils;
+var tiu = TexImageUtils;
+var gl = null;
+
+var video, canvas;
+
+function pass()
+{
+ document.getElementById("results").innerHTML = "Test <span style='color:green'>PASSED</span>";
+}
+
+function runTest()
+{
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, video);
+ var passing = true;
+ passing &= texture.lastUploadedVideoHeight === 64;
+ passing &= texture.lastUploadedVideoWidth === 64;
+ passing &= Math.abs(texture.lastUploadedVideoTimestamp - 2.0) < 0.001;
+ if (passing) {
+ pass();
+ }
+ finishJSTest();
+}
+
+function init()
+{
+ if (window.testRunner) {
+ testRunner.overridePreference("WebKitWebGLEnabled", "1");
+ testRunner.dumpAsText();
+ }
+
+ video = document.getElementById("video");
+ canvas = document.getElementById("example");
+ gl = canvas.getContext("webgl");
+
+ video.oncanplaythrough = function() {
+ video.oncanplaythrough = runTest;
+ video.currentTime = 2.0;
+ };
+ video.src = "../../canvas/webgl/resources/red-green.ogv";
+}
+</script>
+</head>
+<body onload="init()">
+<video id="video"></video>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="results">Test <span style="color:red">FAILED</span></div>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698