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

mercurial