1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/metro/base/tests/mochiperf/browser_layers_01.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,35 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +"use strict"; 1.8 + 1.9 +function test() { 1.10 + runTests(); 1.11 +} 1.12 + 1.13 +gTests.push({ 1.14 + desc: "rotating divs", 1.15 + run: function run() { 1.16 + yield addTab(chromeRoot + "res/divs_test.html", true); 1.17 + yield hideContextUI(); 1.18 + yield hideNavBar(); 1.19 + 1.20 + let stopwatch = new StopWatch(); 1.21 + let win = Browser.selectedTab.browser.contentWindow; 1.22 + let domUtils = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); 1.23 + yield waitForEvent(win, "teststarted", 5000); 1.24 + // the test runs for five seconds 1.25 + let recordingHandle = domUtils.startFrameTimeRecording(); 1.26 + stopwatch.start(); 1.27 + let event = yield waitForEvent(win, "testfinished", 10000); 1.28 + let intervals = domUtils.stopFrameTimeRecording(recordingHandle); 1.29 + let msec = stopwatch.stop(); 1.30 + 1.31 + PerfTest.declareTest("B924F3FA-4CB5-4453-B131-53E3611E0765", 1.32 + "rotating divs w/text", "graphics", "content", 1.33 + "Measures animation frames for rotating translucent divs on top of a background of text."); 1.34 + PerfTest.declareFrameRateResult(intervals.length, msec, "fps"); 1.35 + } 1.36 +}); 1.37 + 1.38 +