Bug 1516067 [wpt PR 8624] - Add HTMLInputElement select event test, a=testonly
authorkaixinjxq <xiuqix.jiang@intel.com>
Thu, 31 Jan 2019 13:51:09 +0000
changeset 457795 ed3d433da2b64d6e0af3a46a5f5f597a0ffd4239
parent 457794 900ad7c0f0ac573d34a1a210a69e0c2a5c9ed15c
child 457796 a1cb20fc03ed9e01213b13ae5296bc68d2c00d91
push id35518
push useropoprus@mozilla.com
push dateFri, 08 Feb 2019 09:55:14 +0000
treeherdermozilla-central@3a3e393396f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1516067
milestone67.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 1516067 [wpt PR 8624] - Add HTMLInputElement select event test, a=testonly Automatic update from web-platform-tests Add HTMLInputElement select event test (#8624) * Add HTMLInputElement select event test * Address @jdm's comments -- wpt-commits: 0c17bdc23f7e57994452fc669f6d0bcd371299d1 wpt-pr: 8624
testing/web-platform/tests/html/semantics/forms/the-input-element/event-select-manual.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/event-select-manual.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>HTMLInputElement Test: select event</title>
+<link rel="author" title="Intel" href="www.intel.com/">
+<meta name="flags" content="interact">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-textarea/input-select">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<form id="testForm" name="testForm">
+  <input id="testInput" type="text" value="0123456789"/>
+</form>
+
+<h2>Description</h2>
+<p>
+  This test validates that select characters in input element should fired select event.
+</p>
+
+<h2>Test steps:</h2>
+<ol>
+  <li>
+    Select any numeric characters in the input flag below
+  </li>
+</ol>
+
+<script>
+
+let input = document.getElementById("testInput");
+
+setup({explicit_done : true, explicit_timeout : true});
+
+on_event(input, "select", evt => {
+  test(() => {
+    assert_greater_than(input.value.substring(input.selectionStart, input.selectionEnd).length, 0, "Check if the select event captured when text selected");
+  });
+  done();
+});
+
+</script>