gecko/browser/devtools/scratchpad/test/browser_scratchpad_goto_line_ui.js
Peiyong Lin 3e5987353c Bug 937953 - Remove bug numbers from all Scratchpad test file names and update browser.ini. r=benvie
--HG--
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug807924_cannot_convert_to_string.js => browser/devtools/scratchpad/test/browser_scratchpad_cannot_convert_to_string.js
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug_646070_chrome_context_pref.js => browser/devtools/scratchpad/test/browser_scratchpad_chrome_context_pref.js
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug_653427_confirm_close.js => browser/devtools/scratchpad/test/browser_scratchpad_confirm_close.js
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug756681_display_non_error_exceptions.js => browser/devtools/scratchpad/test/browser_scratchpad_display_non_error_exceptions.js
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug690552_display_outputs_errors.js => browser/devtools/scratchpad/test/browser_scratchpad_display_outputs_errors.js
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug_699130_edit_ui_updates.js => browser/devtools/scratchpad/test/browser_scratchpad_edit_ui_updates.js
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug_679467_falsy.js => browser/devtools/scratchpad/test/browser_scratchpad_falsy.js
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug714942_goto_line_ui.js => browser/devtools/scratchpad/test/browser_scratchpad_goto_line_ui.js
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug_650760_help_key.js => browser/devtools/scratchpad/test/browser_scratchpad_help_key.js
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug_644413_modeline.js => browser/devtools/scratchpad/test/browser_scratchpad_modeline.js
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug_651942_recent_files.js => browser/devtools/scratchpad/test/browser_scratchpad_recent_files.js
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug740948_reload_and_run.js => browser/devtools/scratchpad/test/browser_scratchpad_reload_and_run.js
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug684546_reset_undo.js => browser/devtools/scratchpad/test/browser_scratchpad_reset_undo.js
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug_751744_revert_to_saved.js => browser/devtools/scratchpad/test/browser_scratchpad_revert_to_saved.js
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug_660560_tab.js => browser/devtools/scratchpad/test/browser_scratchpad_tab.js
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug_669612_unsaved.js => browser/devtools/scratchpad/test/browser_scratchpad_unsaved.js
rename : browser/devtools/scratchpad/test/browser_scratchpad_bug_661762_wrong_window_focus.js => browser/devtools/scratchpad/test/browser_scratchpad_wrong_window_focus.js
2013-11-15 21:47:02 -05:00

44 lines
1.2 KiB
JavaScript

/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/* Bug 714942 */
function test()
{
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function browserLoad() {
gBrowser.selectedBrowser.removeEventListener("load", browserLoad, true);
openScratchpad(runTests);
}, true);
content.location = "data:text/html,<p>test the 'Jump to line' feature in Scratchpad";
}
function runTests(aWindow, aScratchpad)
{
let editor = aScratchpad.editor;
let text = "foobar bug650345\nBug650345 bazbaz\nfoobar omg\ntest";
editor.setText(text);
editor.setCursor({ line: 0, ch: 0 });
let oldPrompt = editor.openDialog;
let desiredValue;
editor.openDialog = function (text, cb) {
cb(desiredValue);
};
desiredValue = 3;
EventUtils.synthesizeKey("J", {accelKey: true}, aWindow);
is(editor.getCursor().line, 2, "line is correct");
desiredValue = 2;
aWindow.goDoCommand("cmd_gotoLine")
is(editor.getCursor().line, 1, "line is correct (again)");
editor.openDialog = oldPrompt;
finish();
}