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

Side by Side 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, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../canvas/webgl/resources/webgl-test-utils-full.js"></script>
5 <script src="../../canvas/webgl/resources/tex-image-and-sub-image-utils.js"></sc ript>
6 <script src="../../../resources/js-test.js"></script>
7 <script>
8
9 window.jsTestIsAsync = true;
10
11 var wtu = WebGLTestUtils;
12 var tiu = TexImageUtils;
13 var gl = null;
14
15 var video, canvas;
16
17 function pass()
18 {
19 document.getElementById("results").innerHTML = "Test <span style='color:gree n'>PASSED</span>";
20 }
21
22 function runTest()
23 {
24 var texture = gl.createTexture();
25 gl.bindTexture(gl.TEXTURE_2D, texture);
26 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, video);
27 var passing = true;
28 passing &= texture.lastUploadedVideoHeight === 64;
29 passing &= texture.lastUploadedVideoWidth === 64;
30 passing &= Math.abs(texture.lastUploadedVideoTimestamp - 2.0) < 0.001;
31 if (passing) {
32 pass();
33 }
34 finishJSTest();
35 }
36
37 function init()
38 {
39 if (window.testRunner) {
40 testRunner.overridePreference("WebKitWebGLEnabled", "1");
41 testRunner.dumpAsText();
42 }
43
44 video = document.getElementById("video");
45 canvas = document.getElementById("example");
46 gl = canvas.getContext("webgl");
47
48 video.oncanplaythrough = function() {
49 video.oncanplaythrough = runTest;
50 video.currentTime = 2.0;
51 };
52 video.src = "../../canvas/webgl/resources/red-green.ogv";
53 }
54 </script>
55 </head>
56 <body onload="init()">
57 <video id="video"></video>
58 <canvas id="example" width="32" height="32"></canvas>
59 <div id="results">Test <span style="color:red">FAILED</span></div>
60 </body>
61 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698