| Index: third_party/WebKit/PerformanceTests/Canvas/upload-video-to-texture.html
|
| diff --git a/third_party/WebKit/PerformanceTests/Canvas/upload-video-to-texture.html b/third_party/WebKit/PerformanceTests/Canvas/upload-video-to-texture.html
|
| index f19b22f36e07c152ac78b3fc4323589c8871916c..55034ab8330bb619a10085c1d82048032c4ef978 100644
|
| --- a/third_party/WebKit/PerformanceTests/Canvas/upload-video-to-texture.html
|
| +++ b/third_party/WebKit/PerformanceTests/Canvas/upload-video-to-texture.html
|
| @@ -9,29 +9,13 @@ var videoElement = document.getElementById("video");
|
| var canvas3D = document.createElement('canvas');
|
| var gl = canvas3D.getContext('webgl');
|
| if(!gl)
|
| - CanvasRunner.logFatalError("\nWebGL is not supported or enabled on this platform!\n");
|
| + CanvasRunner.logFatalError("WebGL is not supported or enabled on this platform!");
|
|
|
| function setSize(width, height) {
|
| canvas3D.width = width;
|
| canvas3D.height = height;
|
| }
|
|
|
| -function addPlayCallback(videoElement) {
|
| - // This logic makes sure this perf test starts after playing the video.
|
| - videoElement.addEventListener("canplaythrough", startVideo, true);
|
| - videoElement.addEventListener("play", startPerfTest, true);
|
| - videoElement.addEventListener('error', function(ev) {
|
| - CanvasRunner.logFatalError("\nmp4 codec is not supported on this platform. Received error event:" + ev.target.error.code + "\n");
|
| - }, false);
|
| - videoElement.src = "../resources/bear-1280x720.mp4";
|
| -}
|
| -
|
| -function startVideo() {
|
| - // loop can emit this event again.
|
| - videoElement.removeEventListener("canplaythrough", startVideo, true);
|
| - videoElement.play();
|
| -}
|
| -
|
| function startPerfTest() {
|
| CanvasRunner.start({
|
| description: "This bench test checks the speed on texImage2D(Video) on Webgl.",
|
| @@ -72,7 +56,12 @@ function postRun() {
|
|
|
| window.onload = function () {
|
| setSize(1, 1);
|
| - addPlayCallback(videoElement);
|
| +
|
| + videoElement.src = "resources/bear-1280x720.mp4";
|
| + if(!videoElement.canPlayType('video/mp4').replace(/no/, '')) {
|
| + CanvasRunner.logFatalError("video/mp4 is unsupported");
|
| + };
|
| + CanvasRunner.startPlayingAndWaitForVideo(videoElement, startPerfTest);
|
| }
|
|
|
| </script>
|
|
|