mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 17:25:36 +00:00
Bug 1404371 - migrate and rename browser_webconsole_input_expansion.js;r=Honza
MozReview-Commit-ID: JAS13KdCDoP --HG-- rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_input_expansion.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_input_expansion.js extra : rebase_source : 375242c390603892d79d85c5dd6d425b615e4e97
This commit is contained in:
parent
a0f25f9c56
commit
fc2ae75233
@ -220,6 +220,7 @@ skip-if = os != 'mac' # The tested ctrl+key shortcuts are OSX only
|
||||
[browser_jsterm_history.js]
|
||||
[browser_jsterm_history_persist.js]
|
||||
[browser_jsterm_history_nav.js]
|
||||
[browser_jsterm_input_expansion.js]
|
||||
[browser_jsterm_inspect.js]
|
||||
[browser_jsterm_multiline.js]
|
||||
[browser_jsterm_no_autocompletion_on_defined_variables.js]
|
||||
@ -286,8 +287,6 @@ skip-if = true # Bug 1404382
|
||||
skip-if = true # Bug 1404883
|
||||
# old console skip-if = (os == 'win' && bits == 64) # Bug 1390001
|
||||
[browser_webconsole_init.js]
|
||||
[browser_webconsole_input_expansion.js]
|
||||
skip-if = true # Bug 1404371
|
||||
[browser_webconsole_input_field_focus_on_panel_select.js]
|
||||
skip-if = true # Bug 1405343
|
||||
[browser_webconsole_input_focus.js]
|
||||
|
@ -5,42 +5,34 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
// See Bug 588967.
|
||||
// Check that the jsterm input supports multiline values. See Bug 588967.
|
||||
|
||||
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
|
||||
"test/test-console.html";
|
||||
const TEST_URI = "data:text/html;charset=utf-8,Test for jsterm multine input";
|
||||
|
||||
add_task(function* () {
|
||||
yield loadTab(TEST_URI);
|
||||
add_task(async function () {
|
||||
let hud = await openNewTabAndConsole(TEST_URI);
|
||||
|
||||
let hud = yield openConsole();
|
||||
|
||||
testInputExpansion(hud);
|
||||
});
|
||||
|
||||
function testInputExpansion(hud) {
|
||||
let input = hud.jsterm.inputNode;
|
||||
|
||||
info("Focus the jsterm input");
|
||||
input.focus();
|
||||
|
||||
is(input.getAttribute("multiline"), "true", "multiline is enabled");
|
||||
|
||||
let ordinaryHeight = input.clientHeight;
|
||||
|
||||
// Tests if the inputNode expands.
|
||||
// Set a multiline value
|
||||
input.value = "hello\nworld\n";
|
||||
|
||||
// Set the caret at the end of input
|
||||
let length = input.value.length;
|
||||
input.selectionEnd = length;
|
||||
input.selectionStart = length;
|
||||
// Performs an "d". This will trigger/test for the input event that should
|
||||
// change the height of the inputNode.
|
||||
|
||||
info("Type 'd' in jsterm to trigger height change for the input");
|
||||
EventUtils.synthesizeKey("d", {});
|
||||
ok(input.clientHeight > ordinaryHeight, "the input expanded");
|
||||
|
||||
// Test if the inputNode shrinks again.
|
||||
info("Erase the value and test if the inputNode shrinks again");
|
||||
input.value = "";
|
||||
EventUtils.synthesizeKey("d", {});
|
||||
is(input.clientHeight, ordinaryHeight, "the input's height is normal again");
|
||||
|
||||
input = length = null;
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user