Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 | openProfiler(tab, runTests); |
michael@0 | 16 | }); |
michael@0 | 17 | } |
michael@0 | 18 | |
michael@0 | 19 | function runTests(toolbox) { |
michael@0 | 20 | let panel = toolbox.getPanel("jsprofiler"); |
michael@0 | 21 | let record = gPanel.controls.record; |
michael@0 | 22 | |
michael@0 | 23 | panel.once("started", () => { |
michael@0 | 24 | is(getSidebarItem(1, panel).attachment.state, PROFILE_RUNNING); |
michael@0 | 25 | |
michael@0 | 26 | openConsole(gTab, (hud) => { |
michael@0 | 27 | panel.once("stopped", () => { |
michael@0 | 28 | is(getSidebarItem(1, panel).attachment.state, PROFILE_COMPLETED); |
michael@0 | 29 | tearDown(gTab, () => gTab = gPanel = null); |
michael@0 | 30 | }); |
michael@0 | 31 | |
michael@0 | 32 | hud.jsterm.execute("console.profileEnd()"); |
michael@0 | 33 | }); |
michael@0 | 34 | }); |
michael@0 | 35 | |
michael@0 | 36 | record.click(); |
michael@0 | 37 | } |