1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/profiler/test/browser_profiler_console_api.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,35 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + * http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +const URL = "data:text/html;charset=utf8,<p>JavaScript Profiler test</p>"; 1.8 + 1.9 +let gTab, gPanel; 1.10 + 1.11 +function test() { 1.12 + waitForExplicitFinish(); 1.13 + 1.14 + setUp(URL, (tab, browser, panel) => { 1.15 + gTab = tab; 1.16 + gPanel = panel; 1.17 + 1.18 + openConsole(tab, testConsoleProfile); 1.19 + }); 1.20 +} 1.21 + 1.22 +function testConsoleProfile(hud) { 1.23 + hud.jsterm.clearOutput(true); 1.24 + 1.25 + let profilesStarted = 0; 1.26 + 1.27 + gPanel.once("parsed", () => { 1.28 + let profile = gPanel.activeProfile; 1.29 + 1.30 + is(profile.name, "Profile 1", "Profile name is OK"); 1.31 + is(gPanel.sidebar.selectedItem, gPanel.sidebar.getItemByProfile(profile), "Sidebar is OK"); 1.32 + is(gPanel.sidebar.selectedItem.attachment.state, PROFILE_COMPLETED); 1.33 + tearDown(gTab, () => gTab = gPanel = null); 1.34 + }); 1.35 + 1.36 + hud.jsterm.execute("console.profile()"); 1.37 + hud.jsterm.execute("console.profileEnd()"); 1.38 +} 1.39 \ No newline at end of file