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 BASE = "http://example.com/browser/browser/devtools/profiler/test/"; |
michael@0 | 5 | const URL = BASE + "mock_profiler_bug_834878_page.html"; |
michael@0 | 6 | const SCRIPT = BASE + "mock_profiler_bug_834878_script.js"; |
michael@0 | 7 | |
michael@0 | 8 | function test() { |
michael@0 | 9 | waitForExplicitFinish(); |
michael@0 | 10 | |
michael@0 | 11 | setUp(URL, function onSetUp(tab, browser, panel) { |
michael@0 | 12 | let data = { uri: SCRIPT, line: 5, isChrome: false }; |
michael@0 | 13 | |
michael@0 | 14 | panel.displaySource(data).then(function onOpen() { |
michael@0 | 15 | let target = TargetFactory.forTab(tab); |
michael@0 | 16 | let dbg = gDevTools.getToolbox(target).getPanel("jsdebugger"); |
michael@0 | 17 | let view = dbg.panelWin.DebuggerView; |
michael@0 | 18 | |
michael@0 | 19 | is(view.Sources.selectedValue, data.uri, "URI is different"); |
michael@0 | 20 | is(view.editor.getCursor().line, data.line - 1, "Line is different"); |
michael@0 | 21 | |
michael@0 | 22 | // Test the case where script is already loaded. |
michael@0 | 23 | view.editor.setCursor({ line: 1, ch: 1 }); |
michael@0 | 24 | gDevTools.showToolbox(target, "jsprofiler").then(function () { |
michael@0 | 25 | panel.displaySource(data).then(function onOpenAgain() { |
michael@0 | 26 | is(view.editor.getCursor().line, data.line - 1, |
michael@0 | 27 | "Line is different"); |
michael@0 | 28 | tearDown(tab); |
michael@0 | 29 | }); |
michael@0 | 30 | }); |
michael@0 | 31 | }); |
michael@0 | 32 | }); |
michael@0 | 33 | } |