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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial