1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/profiler/test/browser_profiler_console_api_mixed.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,37 @@ 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 + openProfiler(tab, runTests); 1.19 + }); 1.20 +} 1.21 + 1.22 +function runTests(toolbox) { 1.23 + let panel = toolbox.getPanel("jsprofiler"); 1.24 + let record = gPanel.controls.record; 1.25 + 1.26 + panel.once("started", () => { 1.27 + is(getSidebarItem(1, panel).attachment.state, PROFILE_RUNNING); 1.28 + 1.29 + openConsole(gTab, (hud) => { 1.30 + panel.once("stopped", () => { 1.31 + is(getSidebarItem(1, panel).attachment.state, PROFILE_COMPLETED); 1.32 + tearDown(gTab, () => gTab = gPanel = null); 1.33 + }); 1.34 + 1.35 + hud.jsterm.execute("console.profileEnd()"); 1.36 + }); 1.37 + }); 1.38 + 1.39 + record.click(); 1.40 +} 1.41 \ No newline at end of file