test.prototype.start = function()

in 2019/media/webglTest.js [72:109]


  test.prototype.start = function(runner, video) {
    if (video['webkitDecodedFrameCount'] === undefined) {
      runner.fail('UserAgent needs to support ' +
          '\'video.webkitDecodedFrameCount\' to execute this test.');
    }
    var webglHandler = setupWebglTest(video, runner, videoStream);
    video.addEventListener('timeupdate', function onTimeUpdate(e) {
      test.prototype.status =
          '(' + webglHandler.getVideoFrameRate().toFixed(2) + ', ' +
          webglHandler.getWebglFrameRate().toFixed(2) + ')';
      runner.updateStatus();
      if (!video.paused && video.currentTime >= 15) {
        video.removeEventListener('timeupdate', onTimeUpdate);
        video.pause();
        if (webglHandler.getVideoFrameRate() < 0 ||
            webglHandler.getWebglFrameRate() < 0) {
          test.prototype.status = 'Fail';
          runner.fail('UserAgent was unable to render any frames.');
        }
        // Screen refresh rates are capped at 60 so we shouldn't expect greater
        // than 60 fps perfomance.
        if (videoStream.get('fps') < 56) {
          var threshold = 0.994;
          runner.checkGE(webglHandler.getVideoFrameRate(),
              videoStream.get('fps') * threshold, 'Video frame rate');
          runner.checkGE(webglHandler.getWebglFrameRate(),
              videoStream.get('fps') * threshold, 'WebGL frame rate');
        } else {
          runner.checkGE(
              webglHandler.getVideoFrameRate(), 56, 'Video frame rate');
          runner.checkGE(
              webglHandler.getWebglFrameRate(), 56, 'WebGL frame rate');
        }
        runner.succeed();
      }
    });
    webglHandler.play();
  };