Bug 1404371 - migrate and rename browser_webconsole_input_expansion.js;r=Honza
MozReview-Commit-ID: JAS13KdCDoP
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
@@ -215,16 +215,17 @@ skip-if = true # Bug 1403188
[browser_jsterm_completion.js]
[browser_jsterm_copy_command.js]
[browser_jsterm_ctrl_key_nav.js]
skip-if = os != 'mac' # The tested ctrl+key shortcuts are OSX only
[browser_jsterm_dollar.js]
[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]
[browser_jsterm_no_input_and_tab_key_pressed.js]
[browser_jsterm_no_input_change_and_tab_key_pressed.js]
[browser_jsterm_popup_close_on_tab_switch.js]
[browser_jsterm_popup.js]
[browser_jsterm_selfxss.js]
@@ -282,18 +283,16 @@ skip-if = true # Bug 1404382
[browser_webconsole_hpkp_invalid-headers.js]
[browser_webconsole_hsts_invalid-headers.js]
[browser_webconsole_iframe_wrong_hud.js]
skip-if = true # Bug 1404378
[browser_webconsole_ineffective_iframe_sandbox_warning.js]
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]
[browser_webconsole_insecure_passwords_about_blank_web_console_warning.js]
skip-if = true # Bug 1404884
[browser_webconsole_insecure_passwords_web_console_warning.js]
skip-if = true # Bug 1404888
# old console skip-if = true # Bug 1110500 - mouse event failure in test
rename from devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_input_expansion.js
rename to devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_input_expansion.js
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_input_expansion.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_input_expansion.js
@@ -1,46 +1,38 @@
/* -*- 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/ */
"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);
-
- let hud = yield openConsole();
+add_task(async function () {
+ let hud = await openNewTabAndConsole(TEST_URI);
- 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;
-}
+});