OLD | NEW |
---|---|
(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 &= texture.lastUploadedVideoTimestamp === 2.0; | |
Ken Russell (switch to Gerrit)
2017/03/24 21:47:55
It'd be awesome if this particular part of the tes
| |
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> | |
OLD | NEW |