mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
55 lines
1.4 KiB
JavaScript
55 lines
1.4 KiB
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
const URL = "data:text/html;charset=utf8,<p>JavaScript Profiler test</p>";
|
|
const BASE = "http://example.com/browser/browser/devtools/profiler/test/";
|
|
const PAGE = BASE + "mock_console_api.html";
|
|
|
|
let gTab, gPanel, gToolbox;
|
|
|
|
function test() {
|
|
waitForExplicitFinish();
|
|
|
|
setUp(URL, (tab, browser, panel) => {
|
|
gTab = tab;
|
|
gPanel = panel;
|
|
|
|
openProfiler(tab, (toolbox) => {
|
|
gToolbox = toolbox;
|
|
loadUrl(PAGE, tab, () => {
|
|
gPanel.sidebar.on("stateChanged", (_, item) => {
|
|
if (item.attachment.state !== PROFILE_COMPLETED)
|
|
return;
|
|
|
|
runTests();
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
|
|
function runTests() {
|
|
is(getSidebarItem(1).attachment.state, PROFILE_COMPLETED);
|
|
|
|
gPanel.once("parsed", () => {
|
|
function assertSampleAndFinish() {
|
|
let [win,doc] = getProfileInternals();
|
|
let sample = doc.getElementsByClassName("samplePercentage");
|
|
|
|
if (sample.length <= 0)
|
|
return void setTimeout(assertSampleAndFinish, 100);
|
|
|
|
ok(sample.length > 0, "We have Cleopatra UI displayed");
|
|
tearDown(gTab, () => {
|
|
gTab = null;
|
|
gPanel = null;
|
|
gToolbox = null;
|
|
});
|
|
}
|
|
|
|
assertSampleAndFinish();
|
|
});
|
|
|
|
let profile = gPanel.profiles.get(1);
|
|
gPanel.sidebar.selectedItem = gPanel.sidebar.getItemByProfile(profile);
|
|
} |