mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
42 lines
1.3 KiB
JavaScript
42 lines
1.3 KiB
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
// Tests that line graphs hide the 'max' tooltip when the distance between
|
|
// the 'min' and 'max' tooltip is too small.
|
|
|
|
const TEST_DATA = [{ delta: 100, value: 60 }, { delta: 200, value: 59.9 }];
|
|
let {LineGraphWidget} = Cu.import("resource:///modules/devtools/Graphs.jsm", {});
|
|
let {DOMHelpers} = Cu.import("resource:///modules/devtools/DOMHelpers.jsm", {});
|
|
let {Promise} = devtools.require("resource://gre/modules/Promise.jsm");
|
|
let {Hosts} = devtools.require("devtools/framework/toolbox-hosts");
|
|
|
|
let test = Task.async(function*() {
|
|
yield promiseTab("about:blank");
|
|
yield performTest();
|
|
gBrowser.removeCurrentTab();
|
|
finish();
|
|
});
|
|
|
|
function* performTest() {
|
|
let [host, win, doc] = yield createHost();
|
|
let graph = new LineGraphWidget(doc.body, "fps");
|
|
|
|
yield testGraph(graph);
|
|
|
|
graph.destroy();
|
|
host.destroy();
|
|
}
|
|
|
|
function* testGraph(graph) {
|
|
yield graph.setDataWhenReady(TEST_DATA);
|
|
|
|
is(graph._gutter.hidden, false,
|
|
"The gutter should not be hidden.");
|
|
is(graph._maxTooltip.hidden, true,
|
|
"The max tooltip should be hidden.");
|
|
is(graph._avgTooltip.hidden, false,
|
|
"The avg tooltip should not be hidden.");
|
|
is(graph._minTooltip.hidden, false,
|
|
"The min tooltip should not be hidden.");
|
|
}
|