mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
e3013f0300
--HG-- rename : browser/devtools/profiler/test/browser_profiler_categories.js => browser/devtools/performance/test/browser_profiler_categories.js rename : browser/devtools/profiler/test/browser_profiler_content-check.js => browser/devtools/performance/test/browser_profiler_content-check.js rename : browser/devtools/profiler/test/browser_profiler_tree-abstract-01.js => browser/devtools/performance/test/browser_profiler_tree-abstract-01.js rename : browser/devtools/profiler/test/browser_profiler_tree-abstract-02.js => browser/devtools/performance/test/browser_profiler_tree-abstract-02.js rename : browser/devtools/profiler/test/browser_profiler_tree-abstract-03.js => browser/devtools/performance/test/browser_profiler_tree-abstract-03.js rename : browser/devtools/profiler/test/browser_profiler_tree-abstract-04.js => browser/devtools/performance/test/browser_profiler_tree-abstract-04.js rename : browser/devtools/profiler/test/browser_profiler_tree-frame-node.js => browser/devtools/performance/test/browser_profiler_tree-frame-node.js rename : browser/devtools/profiler/test/browser_profiler_tree-model-01.js => browser/devtools/performance/test/browser_profiler_tree-model-01.js rename : browser/devtools/profiler/test/browser_profiler_tree-model-02.js => browser/devtools/performance/test/browser_profiler_tree-model-02.js rename : browser/devtools/profiler/test/browser_profiler_tree-model-03.js => browser/devtools/performance/test/browser_profiler_tree-model-03.js rename : browser/devtools/profiler/test/browser_profiler_tree-model-04.js => browser/devtools/performance/test/browser_profiler_tree-model-04.js rename : browser/devtools/profiler/test/browser_profiler_tree-model-05.js => browser/devtools/performance/test/browser_profiler_tree-model-05.js rename : browser/devtools/profiler/test/browser_profiler_tree-view-01.js => browser/devtools/performance/test/browser_profiler_tree-view-01.js rename : browser/devtools/profiler/test/browser_profiler_tree-view-02.js => browser/devtools/performance/test/browser_profiler_tree-view-02.js rename : browser/devtools/profiler/test/browser_profiler_tree-view-03.js => browser/devtools/performance/test/browser_profiler_tree-view-03.js rename : browser/devtools/profiler/test/browser_profiler_tree-view-04.js => browser/devtools/performance/test/browser_profiler_tree-view-04.js rename : browser/devtools/profiler/test/browser_profiler_tree-view-05.js => browser/devtools/performance/test/browser_profiler_tree-view-05.js rename : browser/devtools/profiler/test/browser_profiler_tree-view-06.js => browser/devtools/performance/test/browser_profiler_tree-view-06.js rename : browser/devtools/profiler/test/browser_profiler_tree-view-07.js => browser/devtools/performance/test/browser_profiler_tree-view-07.js rename : browser/devtools/timeline/test/browser_timeline_blueprint.js => browser/devtools/performance/test/browser_timeline_blueprint.js rename : browser/devtools/profiler/utils/global.js => browser/devtools/shared/profiler/global.js rename : browser/devtools/profiler/utils/tree-model.js => browser/devtools/shared/profiler/tree-model.js rename : browser/devtools/profiler/utils/tree-view.js => browser/devtools/shared/profiler/tree-view.js rename : browser/devtools/timeline/widgets/global.js => browser/devtools/shared/timeline/global.js rename : browser/devtools/timeline/widgets/marker-details.js => browser/devtools/shared/timeline/marker-details.js rename : browser/devtools/timeline/widgets/markers-overview.js => browser/devtools/shared/timeline/markers-overview.js rename : browser/devtools/timeline/widgets/memory-overview.js => browser/devtools/shared/timeline/memory-overview.js rename : browser/devtools/timeline/widgets/waterfall.js => browser/devtools/shared/timeline/waterfall.js
89 lines
3.0 KiB
JavaScript
89 lines
3.0 KiB
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
/**
|
|
* Tests if the waterfall is properly built after making a selection
|
|
* and the child nodes are styled correctly.
|
|
*/
|
|
|
|
var gRGB_TO_HSL = {
|
|
"rgb(193, 132, 214)": "hsl(285,50%,68%)",
|
|
"rgb(152, 61, 183)": "hsl(285,50%,48%)",
|
|
"rgb(161, 223, 138)": "hsl(104,57%,71%)",
|
|
"rgb(96, 201, 58)": "hsl(104,57%,51%)",
|
|
"rgb(240, 195, 111)": "hsl(39,82%,69%)",
|
|
"rgb(227, 155, 22)": "hsl(39,82%,49%)",
|
|
"rgb(204, 204, 204)": "hsl(0,0%,80%)",
|
|
"rgb(153, 153, 153)": "hsl(0,0%,60%)",
|
|
};
|
|
|
|
add_task(function*() {
|
|
let { target, panel } = yield initTimelinePanel(SIMPLE_URL);
|
|
let { TIMELINE_BLUEPRINT } = devtools.require("devtools/shared/timeline/global");
|
|
let { $, $$, EVENTS, TimelineController } = panel.panelWin;
|
|
|
|
yield TimelineController.toggleRecording();
|
|
ok(true, "Recording has started.");
|
|
|
|
let updated = 0;
|
|
panel.panelWin.on(EVENTS.OVERVIEW_UPDATED, () => updated++);
|
|
|
|
ok((yield waitUntil(() => updated > 0)),
|
|
"The overview graphs were updated a bunch of times.");
|
|
ok((yield waitUntil(() => TimelineController.getMarkers().length > 0)),
|
|
"There are some markers available.");
|
|
|
|
yield TimelineController.toggleRecording();
|
|
ok(true, "Recording has ended.");
|
|
|
|
// Test the table sidebars.
|
|
|
|
for (let sidebar of [
|
|
...$$(".timeline-header-sidebar"),
|
|
...$$(".timeline-marker-sidebar")
|
|
]) {
|
|
is(sidebar.getAttribute("width"), "150",
|
|
"The table's sidebar width is correct.");
|
|
}
|
|
|
|
// Test the table ticks.
|
|
|
|
for (let tick of $$(".timeline-header-tick")) {
|
|
ok(tick.getAttribute("value").match(/^\d+ ms$/),
|
|
"The table's timeline ticks appear to have correct labels.");
|
|
ok(tick.style.transform.match(/^translateX\(.*px\)$/),
|
|
"The table's timeline ticks appear to have proper translations.");
|
|
}
|
|
|
|
// Test the marker bullets.
|
|
|
|
for (let bullet of $$(".timeline-marker-bullet")) {
|
|
let type = bullet.getAttribute("type");
|
|
|
|
ok(type in TIMELINE_BLUEPRINT,
|
|
"The bullet type is present in the timeline blueprint.");
|
|
is(gRGB_TO_HSL[bullet.style.backgroundColor], TIMELINE_BLUEPRINT[type].fill,
|
|
"The bullet's background color is correct.");
|
|
is(gRGB_TO_HSL[bullet.style.borderColor], TIMELINE_BLUEPRINT[type].stroke,
|
|
"The bullet's border color is correct.");
|
|
}
|
|
|
|
// Test the marker bars.
|
|
|
|
for (let bar of $$(".timeline-marker-bar")) {
|
|
let type = bar.getAttribute("type");
|
|
|
|
ok(type in TIMELINE_BLUEPRINT,
|
|
"The bar type is present in the timeline blueprint.");
|
|
is(gRGB_TO_HSL[bar.style.backgroundColor], TIMELINE_BLUEPRINT[type].fill,
|
|
"The bar's background color is correct.");
|
|
is(gRGB_TO_HSL[bar.style.borderColor], TIMELINE_BLUEPRINT[type].stroke,
|
|
"The bar's border color is correct.");
|
|
|
|
ok(bar.getAttribute("width") > 0,
|
|
"The bar appears to have a proper width.");
|
|
ok(bar.style.transform.match(/^translateX\(.*px\)$/),
|
|
"The bar appears to have proper translations.");
|
|
}
|
|
});
|