browser/devtools/profiler/test/browser_profiler_console_api.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

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

mercurial