Bug 1404844 - Migrate browser_webconsole_bug_623749_ctrl_a_select_all_winnt.js to the new frontend r=jdescottes

MozReview-Commit-ID: 6GbekLySWc9

--HG--
rename : devtools/client/webconsole/test/browser_webconsole_bug_623749_ctrl_a_select_all_winnt.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_ctrl_a_select_all.js
extra : rebase_source : 4b0f0899a127e939b44963a577fd39c856f6b423
This commit is contained in:
Michael Ratcliffe 2018-02-12 15:59:46 +00:00
Родитель a8f0ea9625
Коммит 9eed559d45
2 изменённых файлов: 38 добавлений и 0 удалений

Просмотреть файл

@ -212,6 +212,7 @@ skip-if = true # Bug 1403188
[browser_jsterm_autocomplete-properties-with-non-alphanumeric-names.js]
[browser_jsterm_completion.js]
[browser_jsterm_copy_command.js]
[browser_jsterm_ctrl_a_select_all.js]
[browser_jsterm_ctrl_key_nav.js]
skip-if = os != 'mac' # The tested ctrl+key shortcuts are OSX only
[browser_jsterm_dollar.js]

Просмотреть файл

@ -0,0 +1,37 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Map Control + A to Select All, In the web console input
/* import-globals-from head.js */
"use strict";
const TEST_URI = "data:text/html;charset=utf-8,Test console select all";
add_task(async function testCtrlA() {
let hud = await openNewTabAndConsole(TEST_URI);
let jsterm = hud.jsterm;
jsterm.setInputValue("Ignore These Four Words");
let inputNode = jsterm.inputNode;
// Test select all with (cmd|control) + a.
EventUtils.synthesizeKey("a", { accelKey: true });
let inputLength = inputNode.selectionEnd - inputNode.selectionStart;
is(inputLength, jsterm.getInputValue().length, "Select all of input");
// (cmd|control) + e cannot be disabled on Linux so skip this section on that
// OS.
if (Services.appinfo.OS !== "Linux") {
// Test do nothing on Control + E.
jsterm.setInputValue("Ignore These Four Words");
inputNode.selectionStart = 0;
EventUtils.synthesizeKey("e", { accelKey: true });
is(inputNode.selectionStart, 0,
"control|cmd + e does not move to end of input");
}
});