Bug 1589844 - Move Input browser-chrome tests to their own directory; r=remote-protocol-reviewers,whimboo,ato
authorMaja Frydrychowicz <mjzffr@gmail.com>
Tue, 22 Oct 2019 13:09:49 +0000
changeset 498544 79a88a2631b2a30de49f2137a8e8b020c8127e99
parent 498543 f6fdb9788557adf48b9f69884a1bbd6b3b8214eb
child 498545 25fba5d1b7ccb3281f996e3b62260bc5310ae9d1
push id114159
push usershindli@mozilla.com
push dateThu, 24 Oct 2019 09:49:00 +0000
treeherdermozilla-inbound@ba30626ccb8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersremote-protocol-reviewers, whimboo, ato
bugs1589844
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1589844 - Move Input browser-chrome tests to their own directory; r=remote-protocol-reviewers,whimboo,ato This also fixes the intermittent timeout on Windows debug by moving the event checks to a separate test. Differential Revision: https://phabricator.services.mozilla.com/D49995
remote/test/browser/browser.ini
remote/test/browser/browser_input_dispatchKeyEvent.js
remote/test/browser/browser_input_dispatchKeyEvent_race.js
remote/test/browser/browser_input_dispatchMouseEvent.js
remote/test/browser/doc_input_dispatchKeyEvent_race.html
remote/test/browser/doc_input_events.html
remote/test/browser/input/browser.ini
remote/test/browser/input/browser_dispatchKeyEvent.js
remote/test/browser/input/browser_dispatchKeyEvent_events.js
remote/test/browser/input/browser_dispatchKeyEvent_race.js
remote/test/browser/input/browser_dispatchMouseEvent.js
remote/test/browser/input/doc_dispatchKeyEvent_race.html
remote/test/browser/input/doc_events.html
remote/test/browser/input/head.js
remote/test/moz.build
--- a/remote/test/browser/browser.ini
+++ b/remote/test/browser/browser.ini
@@ -1,24 +1,19 @@
 [DEFAULT]
 tags = remote
 subsuite = remote
 prefs = remote.enabled=true
 support-files =
   chrome-remote-interface.js
-  doc_input_dispatchKeyEvent_race.html
-  doc_input_events.html
   doc_network_requestWillBeSent.html
   file_network_requestWillBeSent.js
   head.js
 
 [browser_cdp.js]
-[browser_input_dispatchKeyEvent.js]
-[browser_input_dispatchKeyEvent_race.js]
-[browser_input_dispatchMouseEvent.js]
 [browser_main_target.js]
 [browser_network_requestWillBeSent.js]
 [browser_page_bringToFront.js]
 [browser_page_captureScreenshot.js]
 [browser_page_frameNavigated.js]
 [browser_page_frameNavigated_iframe.js]
 [browser_page_javascriptDialog_alert.js]
 [browser_page_javascriptDialog_beforeunload.js]
new file mode 100644
--- /dev/null
+++ b/remote/test/browser/input/browser.ini
@@ -0,0 +1,14 @@
+[DEFAULT]
+tags = remote
+subsuite = remote
+prefs = remote.enabled=true
+support-files =
+  doc_events.html
+  doc_dispatchKeyEvent_race.html
+  head.js
+  !/remote/test/browser/head.js
+
+[browser_dispatchKeyEvent.js]
+[browser_dispatchKeyEvent_events.js]
+[browser_dispatchKeyEvent_race.js]
+[browser_dispatchMouseEvent.js]
rename from remote/test/browser/browser_input_dispatchKeyEvent.js
rename to remote/test/browser/input/browser_dispatchKeyEvent.js
--- a/remote/test/browser/browser_input_dispatchKeyEvent.js
+++ b/remote/test/browser/input/browser_dispatchKeyEvent.js
@@ -1,45 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-const { Input: I } = ChromeUtils.import(
-  "chrome://remote/content/domains/parent/Input.jsm"
-);
-
-const { alt, ctrl, meta, shift } = I.Modifier;
-
-// Map of key codes used in this test.
-const KEYCODES = {
-  a: KeyboardEvent.DOM_VK_A,
-  A: KeyboardEvent.DOM_VK_A,
-  b: KeyboardEvent.DOM_VK_B,
-  B: KeyboardEvent.DOM_VK_B,
-  c: KeyboardEvent.DOM_VK_C,
-  C: KeyboardEvent.DOM_VK_C,
-  h: KeyboardEvent.DOM_VK_H,
-  H: KeyboardEvent.DOM_VK_H,
-  Alt: KeyboardEvent.DOM_VK_ALT,
-  ArrowLeft: KeyboardEvent.DOM_VK_LEFT,
-  ArrowRight: KeyboardEvent.DOM_VK_RIGHT,
-  ArrowDown: KeyboardEvent.DOM_VK_DOWN,
-  Backspace: KeyboardEvent.DOM_VK_BACK_SPACE,
-  Control: KeyboardEvent.DOM_VK_CONTROL,
-  Meta: KeyboardEvent.DM_VK_META,
-  Shift: KeyboardEvent.DOM_VK_SHIFT,
-  Tab: KeyboardEvent.DOM_VK_TAB,
-};
-
-const isMac = Services.appinfo.OS === "Darwin";
-
-const PAGE_URL =
-  "http://example.com/browser/remote/test/browser/doc_input_events.html";
-
 add_task(async function testTypingPrintableCharacters() {
   const { client } = await setupForInput(toDataURL("<input>"));
   const { Input } = client;
 
   info("Write 'h'");
   await sendTextKey(Input, "h");
   await checkInputContent("h", 1);
 
@@ -180,92 +148,16 @@ add_task(async function testSelectDelete
     await sendRawKey(Input, "Backspace", meta);
     await dispatchKeyEvent(Input, "Meta", "keyUp");
     await checkInputContent("d4", 0);
   }
 
   await teardown(client);
 });
 
-add_task(async function testShiftEvents() {
-  const { client } = await setupForInput(PAGE_URL);
-  const { Input } = client;
-  await resetEvents();
-
-  await withModifier(Input, "Shift", "shift", "A");
-  await checkInputContent("A", 1);
-  let events = await getEvents();
-  checkEvent(events[0], "keydown", "Shift", "shift", true);
-  checkEvent(events[1], "keydown", "A", "shift", true);
-  checkEvent(events[2], "keypress", "A", "shift", true);
-  checkProperties({ data: "A", inputType: "insertText" }, events[3]);
-  checkEvent(events[4], "keyup", "A", "shift", true);
-  checkEvent(events[5], "keyup", "Shift", "shift", false);
-  await resetEvents();
-
-  await withModifier(Input, "Shift", "shift", "Enter");
-  events = await getEvents();
-  checkEvent(events[2], "keypress", "Enter", "shift", true);
-  await resetEvents();
-
-  await withModifier(Input, "Shift", "shift", "Tab");
-  events = await getEvents();
-  checkEvent(events[1], "keydown", "Tab", "shift", true);
-  await ContentTask.spawn(gBrowser.selectedBrowser, null, function() {
-    const input = content.document.querySelector("input");
-    isnot(input, content.document.activeElement, "input should lose focus");
-  });
-
-  await teardown(client);
-});
-
-add_task(async function testAltEvents() {
-  const { client } = await setupForInput(PAGE_URL);
-  const { Input } = client;
-
-  await withModifier(Input, "Alt", "alt", "a");
-  if (isMac) {
-    await checkInputContent("a", 1);
-  } else {
-    await checkInputContent("", 0);
-  }
-  let events = await getEvents();
-  checkEvent(events[1], "keydown", "a", "alt", true);
-  checkEvent(events[events.length - 1], "keyup", "Alt", "alt", false);
-  await teardown(client);
-});
-
-add_task(async function testControlEvents() {
-  const { client } = await setupForInput(PAGE_URL);
-  const { Input } = client;
-
-  await withModifier(Input, "Control", "ctrl", "`");
-  let events = await getEvents();
-  // no keypress or input event
-  checkEvent(events[1], "keydown", "`", "ctrl", true);
-  checkEvent(events[events.length - 1], "keyup", "Control", "ctrl", false);
-  await teardown(client);
-});
-
-add_task(async function testMetaEvents() {
-  if (!isMac) {
-    return;
-  }
-  const { client } = await setupForInput(PAGE_URL);
-  const { Input } = client;
-
-  await withModifier(Input, "Meta", "meta", "a");
-  let events = await getEvents();
-  // no keypress or input event
-  checkEvent(events[1], "keydown", "a", "meta", true);
-  checkEvent(events[events.length - 1], "keyup", "Meta", "meta", false);
-
-  await teardown(client);
-});
-
 add_task(async function testCtrlShiftArrows() {
   const { client } = await setupForURL(
     toDataURL('<select multiple size="3"><option>a<option>b<option>c</select>')
   );
   const { Input } = client;
 
   await ContentTask.spawn(gBrowser.selectedBrowser, null, function() {
     const select = content.document.querySelector("select");
@@ -283,147 +175,8 @@ add_task(async function testCtrlShiftArr
   await ContentTask.spawn(gBrowser.selectedBrowser, null, function() {
     const select = content.document.querySelector("select");
     ok(select[0].selected, "First option should be selected");
     ok(select[1].selected, "Second option should be selected");
     ok(!select[2].selected, "Third option should not be selected");
   });
   await teardown(client);
 });
-
-add_task(async function testShiftClick() {
-  const { client } = await setupForURL(PAGE_URL);
-  const { Input } = client;
-  await resetEvents();
-
-  await dispatchKeyEvent(Input, "Shift", "rawKeyDown", shift);
-  info("Click the 'pointers' div.");
-  await Input.dispatchMouseEvent({
-    type: "mousePressed",
-    x: 80,
-    y: 180,
-    modifiers: shift,
-  });
-  await Input.dispatchMouseEvent({
-    type: "mouseReleased",
-    x: 80,
-    y: 180,
-    modifiers: shift,
-  });
-  await dispatchKeyEvent(Input, "Shift", "keyUp", shift);
-  let events = await getEvents();
-  checkProperties({ type: "click", shiftKey: true, button: 0 }, events[2]);
-
-  await teardown(client);
-});
-
-function keyForPlatform() {
-  // TODO add cases for other key-combinations as the need arises
-  let primary = ctrl;
-  let primaryKey = "Control";
-  if (isMac) {
-    primary = alt;
-    primaryKey = "Alt";
-  }
-  return { primary, primaryKey };
-}
-
-async function setupForInput(url) {
-  const { client, tab } = await setupForURL(url);
-  info("Focus the input on the page");
-  await ContentTask.spawn(gBrowser.selectedBrowser, null, function() {
-    const input = content.document.querySelector("input");
-    input.focus();
-    is(input, content.document.activeElement, "Input should be focused");
-  });
-  await checkInputContent("", 0);
-  return { client, tab };
-}
-
-async function sendTextKey(Input, key, modifiers = 0) {
-  await dispatchKeyEvent(Input, key, "keyDown", modifiers);
-  await dispatchKeyEvent(Input, key, "keyUp", modifiers);
-}
-
-async function sendText(Input, text) {
-  for (const sym of text) {
-    await sendTextKey(Input, sym);
-  }
-}
-
-async function sendRawKey(Input, key, modifiers = 0) {
-  await dispatchKeyEvent(Input, key, "rawKeyDown", modifiers);
-  await dispatchKeyEvent(Input, key, "keyUp", modifiers);
-}
-
-async function checkBackspace(Input, expected, modifiers = 0) {
-  info("Send Backspace");
-  await sendRawKey(Input, "Backspace", modifiers);
-  await checkInputContent(expected, expected.length);
-}
-
-async function withModifier(Input, modKey, mod, key) {
-  await dispatchKeyEvent(Input, modKey, "rawKeyDown", I.Modifier[mod]);
-  await dispatchKeyEvent(Input, key, "keyDown", I.Modifier[mod]);
-  await dispatchKeyEvent(Input, key, "keyUp", I.Modifier[mod]);
-  await dispatchKeyEvent(Input, modKey, "keyUp");
-}
-
-function dispatchKeyEvent(Input, key, type, modifiers = 0) {
-  info(`Send ${type} for key ${key}`);
-  return Input.dispatchKeyEvent({
-    type,
-    modifiers,
-    windowsVirtualKeyCode: KEYCODES[key],
-    key,
-  });
-}
-
-function getInputContent() {
-  return ContentTask.spawn(gBrowser.selectedBrowser, null, function() {
-    const input = content.document.querySelector("input");
-    return { value: input.value, caret: input.selectionStart };
-  });
-}
-
-async function checkInputContent(expectedValue, expectedCaret) {
-  const { value, caret } = await getInputContent();
-  is(value, expectedValue, "Check input content");
-  is(caret, expectedCaret, "Check position of input caret");
-}
-
-// assuming doc_input_events.html
-async function getEvents() {
-  const events = await ContentTask.spawn(gBrowser.selectedBrowser, null, () => {
-    return content.eval("allEvents");
-  });
-  info(`Events: ${JSON.stringify(events)}`);
-  return events;
-}
-
-// assuming doc_input_events.html
-async function resetEvents() {
-  await ContentTask.spawn(gBrowser.selectedBrowser, null, () => {
-    content.eval("resetEvents()");
-    const events = content.eval("allEvents");
-    is(events.length, 0, "List of events should be empty");
-  });
-}
-
-function resetInput(value = "") {
-  return ContentTask.spawn(gBrowser.selectedBrowser, value, function(arg) {
-    const input = content.document.querySelector("input");
-    input.value = arg;
-    input.focus();
-  });
-}
-
-function checkEvent(event, type, key, property, expectedValue) {
-  let expected = { type, key };
-  expected[property] = expectedValue;
-  checkProperties(expected, event, "Event");
-}
-
-function checkProperties(expectedObj, targetObj, message = "Compare objects") {
-  for (const prop in expectedObj) {
-    is(targetObj[prop], expectedObj[prop], message + `: check ${prop}`);
-  }
-}
new file mode 100644
--- /dev/null
+++ b/remote/test/browser/input/browser_dispatchKeyEvent_events.js
@@ -0,0 +1,137 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const PAGE_URL =
+  "http://example.com/browser/remote/test/browser/input/doc_events.html";
+
+add_task(async function testShiftEvents() {
+  const { client } = await setupForInput(PAGE_URL);
+  const { Input } = client;
+  await resetEvents();
+
+  await withModifier(Input, "Shift", "shift", "A");
+  await checkInputContent("A", 1);
+  let events = await getEvents();
+  checkEvent(events[0], "keydown", "Shift", "shift", true);
+  checkEvent(events[1], "keydown", "A", "shift", true);
+  checkEvent(events[2], "keypress", "A", "shift", true);
+  checkProperties({ data: "A", inputType: "insertText" }, events[3]);
+  checkEvent(events[4], "keyup", "A", "shift", true);
+  checkEvent(events[5], "keyup", "Shift", "shift", false);
+  await resetEvents();
+
+  await withModifier(Input, "Shift", "shift", "Enter");
+  events = await getEvents();
+  checkEvent(events[2], "keypress", "Enter", "shift", true);
+  await resetEvents();
+
+  await withModifier(Input, "Shift", "shift", "Tab");
+  events = await getEvents();
+  checkEvent(events[1], "keydown", "Tab", "shift", true);
+  await ContentTask.spawn(gBrowser.selectedBrowser, null, function() {
+    const input = content.document.querySelector("input");
+    isnot(input, content.document.activeElement, "input should lose focus");
+  });
+
+  await teardown(client);
+});
+
+add_task(async function testAltEvents() {
+  const { client } = await setupForInput(PAGE_URL);
+  const { Input } = client;
+
+  await withModifier(Input, "Alt", "alt", "a");
+  if (isMac) {
+    await checkInputContent("a", 1);
+  } else {
+    await checkInputContent("", 0);
+  }
+  let events = await getEvents();
+  checkEvent(events[1], "keydown", "a", "alt", true);
+  checkEvent(events[events.length - 1], "keyup", "Alt", "alt", false);
+  await teardown(client);
+});
+
+add_task(async function testControlEvents() {
+  const { client } = await setupForInput(PAGE_URL);
+  const { Input } = client;
+
+  await withModifier(Input, "Control", "ctrl", "`");
+  let events = await getEvents();
+  // no keypress or input event
+  checkEvent(events[1], "keydown", "`", "ctrl", true);
+  checkEvent(events[events.length - 1], "keyup", "Control", "ctrl", false);
+  await teardown(client);
+});
+
+add_task(async function testMetaEvents() {
+  if (!isMac) {
+    return;
+  }
+  const { client } = await setupForInput(PAGE_URL);
+  const { Input } = client;
+
+  await withModifier(Input, "Meta", "meta", "a");
+  let events = await getEvents();
+  // no keypress or input event
+  checkEvent(events[1], "keydown", "a", "meta", true);
+  checkEvent(events[events.length - 1], "keyup", "Meta", "meta", false);
+
+  await teardown(client);
+});
+
+add_task(async function testShiftClick() {
+  const { client } = await setupForURL(PAGE_URL);
+  const { Input } = client;
+  await resetEvents();
+
+  await dispatchKeyEvent(Input, "Shift", "rawKeyDown", shift);
+  info("Click the 'pointers' div.");
+  await Input.dispatchMouseEvent({
+    type: "mousePressed",
+    x: 80,
+    y: 180,
+    modifiers: shift,
+  });
+  await Input.dispatchMouseEvent({
+    type: "mouseReleased",
+    x: 80,
+    y: 180,
+    modifiers: shift,
+  });
+  await dispatchKeyEvent(Input, "Shift", "keyUp", shift);
+  let events = await getEvents();
+  checkProperties({ type: "click", shiftKey: true, button: 0 }, events[2]);
+
+  await teardown(client);
+});
+
+async function getEvents() {
+  const events = await ContentTask.spawn(gBrowser.selectedBrowser, null, () => {
+    return content.eval("allEvents");
+  });
+  info(`Events: ${JSON.stringify(events)}`);
+  return events;
+}
+
+async function resetEvents() {
+  await ContentTask.spawn(gBrowser.selectedBrowser, null, () => {
+    content.eval("resetEvents()");
+    const events = content.eval("allEvents");
+    is(events.length, 0, "List of events should be empty");
+  });
+}
+
+function checkEvent(event, type, key, property, expectedValue) {
+  let expected = { type, key };
+  expected[property] = expectedValue;
+  checkProperties(expected, event, "Event");
+}
+
+function checkProperties(expectedObj, targetObj, message = "Compare objects") {
+  for (const prop in expectedObj) {
+    is(targetObj[prop], expectedObj[prop], message + `: check ${prop}`);
+  }
+}
rename from remote/test/browser/browser_input_dispatchKeyEvent_race.js
rename to remote/test/browser/input/browser_dispatchKeyEvent_race.js
--- a/remote/test/browser/browser_input_dispatchKeyEvent_race.js
+++ b/remote/test/browser/input/browser_dispatchKeyEvent_race.js
@@ -22,17 +22,17 @@
 // In order for this to work, we need to be sure that `await Input.dispatchKeyEvent`
 // resolves only after the content page flushed the event handlers (and
 // `window.myVariable = "newValue"` was executed).
 //
 // This can be racy because Input.dispatchKeyEvent and window.myVariable = "newValue" run
 // in different processes.
 
 const PAGE_URL =
-  "http://example.com/browser/remote/test/browser/doc_input_dispatchKeyEvent_race.html";
+  "http://example.com/browser/remote/test/browser/input/doc_dispatchKeyEvent_race.html";
 
 add_task(async function() {
   const { client, tab } = await setupForURL(PAGE_URL);
   is(gBrowser.selectedTab, tab, "Selected tab is the target tab");
 
   const { Input, Runtime } = client;
 
   // Need an enabled Runtime domain to run evaluate.
rename from remote/test/browser/browser_input_dispatchMouseEvent.js
rename to remote/test/browser/input/browser_dispatchMouseEvent.js
rename from remote/test/browser/doc_input_dispatchKeyEvent_race.html
rename to remote/test/browser/input/doc_dispatchKeyEvent_race.html
rename from remote/test/browser/doc_input_events.html
rename to remote/test/browser/input/doc_events.html
new file mode 100644
--- /dev/null
+++ b/remote/test/browser/input/head.js
@@ -0,0 +1,124 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* import-globals-from ../head.js */
+
+Services.scriptloader.loadSubScript(
+  "chrome://mochitests/content/browser/remote/test/browser/head.js",
+  this
+);
+
+const { Input: I } = ChromeUtils.import(
+  "chrome://remote/content/domains/parent/Input.jsm"
+);
+
+const { alt, ctrl, meta, shift } = I.Modifier;
+
+const isMac = Services.appinfo.OS === "Darwin";
+
+// Map of key codes used in Input tests.
+const KEYCODES = {
+  a: KeyboardEvent.DOM_VK_A,
+  A: KeyboardEvent.DOM_VK_A,
+  b: KeyboardEvent.DOM_VK_B,
+  B: KeyboardEvent.DOM_VK_B,
+  c: KeyboardEvent.DOM_VK_C,
+  C: KeyboardEvent.DOM_VK_C,
+  h: KeyboardEvent.DOM_VK_H,
+  H: KeyboardEvent.DOM_VK_H,
+  Alt: KeyboardEvent.DOM_VK_ALT,
+  ArrowLeft: KeyboardEvent.DOM_VK_LEFT,
+  ArrowRight: KeyboardEvent.DOM_VK_RIGHT,
+  ArrowDown: KeyboardEvent.DOM_VK_DOWN,
+  Backspace: KeyboardEvent.DOM_VK_BACK_SPACE,
+  Control: KeyboardEvent.DOM_VK_CONTROL,
+  Meta: KeyboardEvent.DM_VK_META,
+  Shift: KeyboardEvent.DOM_VK_SHIFT,
+  Tab: KeyboardEvent.DOM_VK_TAB,
+};
+
+async function setupForInput(url) {
+  const { client, tab } = await setupForURL(url);
+  info("Focus the input on the page");
+  await ContentTask.spawn(gBrowser.selectedBrowser, null, function() {
+    const input = content.document.querySelector("input");
+    input.focus();
+    is(input, content.document.activeElement, "Input should be focused");
+    is(input.value, "", "Check input content");
+    is(input.selectionStart, 0, "Check position of input caret");
+  });
+  return { client, tab };
+}
+
+async function withModifier(Input, modKey, mod, key) {
+  await dispatchKeyEvent(Input, modKey, "rawKeyDown", I.Modifier[mod]);
+  await dispatchKeyEvent(Input, key, "keyDown", I.Modifier[mod]);
+  await dispatchKeyEvent(Input, key, "keyUp", I.Modifier[mod]);
+  await dispatchKeyEvent(Input, modKey, "keyUp");
+}
+
+function dispatchKeyEvent(Input, key, type, modifiers = 0) {
+  info(`Send ${type} for key ${key}`);
+  return Input.dispatchKeyEvent({
+    type,
+    modifiers,
+    windowsVirtualKeyCode: KEYCODES[key],
+    key,
+  });
+}
+
+function getInputContent() {
+  return ContentTask.spawn(gBrowser.selectedBrowser, null, function() {
+    const input = content.document.querySelector("input");
+    return { value: input.value, caret: input.selectionStart };
+  });
+}
+
+async function checkInputContent(expectedValue, expectedCaret) {
+  const { value, caret } = await getInputContent();
+  is(value, expectedValue, "Check input content");
+  is(caret, expectedCaret, "Check position of input caret");
+}
+
+function keyForPlatform() {
+  // TODO add cases for other key-combinations as the need arises
+  let primary = ctrl;
+  let primaryKey = "Control";
+  if (isMac) {
+    primary = alt;
+    primaryKey = "Alt";
+  }
+  return { primary, primaryKey };
+}
+
+async function sendTextKey(Input, key, modifiers = 0) {
+  await dispatchKeyEvent(Input, key, "keyDown", modifiers);
+  await dispatchKeyEvent(Input, key, "keyUp", modifiers);
+}
+
+async function sendText(Input, text) {
+  for (const sym of text) {
+    await sendTextKey(Input, sym);
+  }
+}
+
+async function sendRawKey(Input, key, modifiers = 0) {
+  await dispatchKeyEvent(Input, key, "rawKeyDown", modifiers);
+  await dispatchKeyEvent(Input, key, "keyUp", modifiers);
+}
+
+async function checkBackspace(Input, expected, modifiers = 0) {
+  info("Send Backspace");
+  await sendRawKey(Input, "Backspace", modifiers);
+  await checkInputContent(expected, expected.length);
+}
+
+function resetInput(value = "") {
+  return ContentTask.spawn(gBrowser.selectedBrowser, value, function(arg) {
+    const input = content.document.querySelector("input");
+    input.value = arg;
+    input.focus();
+  });
+}
--- a/remote/test/moz.build
+++ b/remote/test/moz.build
@@ -1,9 +1,9 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 XPCSHELL_TESTS_MANIFESTS += ["unit/xpcshell.ini"]
-BROWSER_CHROME_MANIFESTS += ["browser/browser.ini"]
+BROWSER_CHROME_MANIFESTS += ["browser/browser.ini", "browser/input/browser.ini"]
 
 with Files("puppeteer/test/**/*.spec.js"):
     IMPACTED_TESTS.flavors += ["puppeteer"]