mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 623749 - Control + A on windows should select all in Web Console; r=msucan
This commit is contained in:
parent
ba5f5753b2
commit
8173997694
@ -124,6 +124,12 @@ MOCHITEST_BROWSER_FILES += \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
MOCHITEST_BROWSER_FILES += \
|
||||
browser_webconsole_bug_623749_ctrl_a_select_all_winnt.js \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
MOCHITEST_BROWSER_FILES += \
|
||||
test-console.html \
|
||||
test-network.html \
|
||||
|
@ -0,0 +1,32 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Test for https://bugzilla.mozilla.org/show_bug.cgi?id=623749
|
||||
// Map Control + A to Select All, In the web console input, on Windows
|
||||
|
||||
function test() {
|
||||
addTab("data:text/html;charset=utf-8,Test console for bug 623749");
|
||||
browser.addEventListener("load", function onLoad() {
|
||||
browser.removeEventListener("load", onLoad, true);
|
||||
openConsole(null, runTest);
|
||||
}, true);
|
||||
}
|
||||
|
||||
function runTest(HUD) {
|
||||
let jsterm = HUD.jsterm;
|
||||
jsterm.setInputValue("Ignore These Four Words");
|
||||
let inputNode = jsterm.inputNode;
|
||||
|
||||
// Test select all with Control + A.
|
||||
EventUtils.synthesizeKey("a", { ctrlKey: true });
|
||||
let inputLength = inputNode.selectionEnd - inputNode.selectionStart;
|
||||
is(inputLength, inputNode.value.length, "Select all of input");
|
||||
|
||||
// Test do nothing on Control + E.
|
||||
jsterm.setInputValue("Ignore These Four Words");
|
||||
inputNode.selectionStart = 0;
|
||||
EventUtils.synthesizeKey("e", { ctrlKey: true });
|
||||
is(inputNode.selectionStart, 0, "Control + E does not move to end of input");
|
||||
|
||||
executeSoon(finishTest);
|
||||
}
|
@ -3115,6 +3115,10 @@ JSTerm.prototype = {
|
||||
switch (aEvent.charCode) {
|
||||
case 97:
|
||||
// control-a
|
||||
if (Services.appinfo.OS == "WINNT") {
|
||||
closePopup = true;
|
||||
break;
|
||||
}
|
||||
let lineBeginPos = 0;
|
||||
if (this.hasMultilineInput()) {
|
||||
// find index of closest newline <= to cursor
|
||||
@ -3132,6 +3136,9 @@ JSTerm.prototype = {
|
||||
break;
|
||||
case 101:
|
||||
// control-e
|
||||
if (Services.appinfo.OS == "WINNT") {
|
||||
break;
|
||||
}
|
||||
let lineEndPos = inputNode.value.length;
|
||||
if (this.hasMultilineInput()) {
|
||||
// find index of closest newline >= cursor
|
||||
|
Loading…
Reference in New Issue
Block a user