browser/metro/base/tests/mochiperf/browser_layers_01.js

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

michael@0 1 /* Any copyright is dedicated to the Public Domain.
michael@0 2 http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 3
michael@0 4 "use strict";
michael@0 5
michael@0 6 function test() {
michael@0 7 runTests();
michael@0 8 }
michael@0 9
michael@0 10 gTests.push({
michael@0 11 desc: "rotating divs",
michael@0 12 run: function run() {
michael@0 13 yield addTab(chromeRoot + "res/divs_test.html", true);
michael@0 14 yield hideContextUI();
michael@0 15 yield hideNavBar();
michael@0 16
michael@0 17 let stopwatch = new StopWatch();
michael@0 18 let win = Browser.selectedTab.browser.contentWindow;
michael@0 19 let domUtils = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
michael@0 20 yield waitForEvent(win, "teststarted", 5000);
michael@0 21 // the test runs for five seconds
michael@0 22 let recordingHandle = domUtils.startFrameTimeRecording();
michael@0 23 stopwatch.start();
michael@0 24 let event = yield waitForEvent(win, "testfinished", 10000);
michael@0 25 let intervals = domUtils.stopFrameTimeRecording(recordingHandle);
michael@0 26 let msec = stopwatch.stop();
michael@0 27
michael@0 28 PerfTest.declareTest("B924F3FA-4CB5-4453-B131-53E3611E0765",
michael@0 29 "rotating divs w/text", "graphics", "content",
michael@0 30 "Measures animation frames for rotating translucent divs on top of a background of text.");
michael@0 31 PerfTest.declareFrameRateResult(intervals.length, msec, "fps");
michael@0 32 }
michael@0 33 });
michael@0 34
michael@0 35

mercurial