|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 * http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 const URL = "data:text/html;charset=utf8,<p>JavaScript Profiler test</p>"; |
|
5 |
|
6 let gTab, gPanel; |
|
7 |
|
8 function test() { |
|
9 waitForExplicitFinish(); |
|
10 |
|
11 setUp(URL, (tab, browser, panel) => { |
|
12 gTab = tab; |
|
13 gPanel = panel; |
|
14 |
|
15 openConsole(tab, testConsoleProfile); |
|
16 }); |
|
17 } |
|
18 |
|
19 function testConsoleProfile(hud) { |
|
20 hud.jsterm.clearOutput(true); |
|
21 |
|
22 let profilesStarted = 0; |
|
23 |
|
24 gPanel.once("parsed", () => { |
|
25 let profile = gPanel.activeProfile; |
|
26 |
|
27 is(profile.name, "Profile 1", "Profile name is OK"); |
|
28 is(gPanel.sidebar.selectedItem, gPanel.sidebar.getItemByProfile(profile), "Sidebar is OK"); |
|
29 is(gPanel.sidebar.selectedItem.attachment.state, PROFILE_COMPLETED); |
|
30 tearDown(gTab, () => gTab = gPanel = null); |
|
31 }); |
|
32 |
|
33 hud.jsterm.execute("console.profile()"); |
|
34 hud.jsterm.execute("console.profileEnd()"); |
|
35 } |