Sha256: 86bead25617d6fa621ae60ea52171a147728290b77a549682e81f6459129c025
Contents?: true
Size: 1.27 KB
Versions: 6
Compression:
Stored size: 1.27 KB
Contents
<!DOCTYPE html> <html> <!-- Copyright 2011 The Closure Library Authors. All Rights Reserved. Use of this source code is governed by the Apache License, Version 2.0. See the COPYING file for details. --> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Closure Unit Tests - goog.debug.FpsDisplay</title> <script src="../base.js"></script> <script> goog.require('goog.debug.FpsDisplay'); goog.require('goog.testing.AsyncTestCase'); goog.require('goog.testing.jsunit'); </script> </head> <body> <script> var asyncTestCase = goog.testing.AsyncTestCase.createAndInstall(); var fpsDisplay; var timer; asyncTestCase.stepTimeout = 10 * 1000; function setUp() { fpsDisplay = new goog.debug.FpsDisplay(); } function tearDown() { goog.dispose(fpsDisplay); window.clearTimeout(timer); } function testRendering() { fpsDisplay.render(); var elem = fpsDisplay.getElement(); assertHTMLEquals('', elem.innerHTML); asyncTestCase.waitForAsync('Waiting for some frames to pass'); timer = window.setTimeout(function() { var fps = parseInt(elem.innerHTML, 10); assertTrue('FPS of ' + fps + ' should be non-negative', fps >= 0); assertTrue('FPS of ' + fps + ' too big', fps < 1000); asyncTestCase.continueTesting(); }, 2000); } </script> </body> </html>
Version data entries
6 entries across 6 versions & 2 rubygems