Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Unified Diff: LayoutTests/fast/forms/number/number-setvalueforuser-skip-spaces.html

Issue 235273003: parsing input type=number should skip spaces (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated review comments Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/forms/number/number-setvalueforuser-skip-spaces.html
diff --git a/LayoutTests/fast/forms/number/number-setvalueforuser-skip-spaces.html b/LayoutTests/fast/forms/number/number-setvalueforuser-skip-spaces.html
new file mode 100644
index 0000000000000000000000000000000000000000..2130c20fc94177bb91755c4b0cd7bd69e56bcda3
--- /dev/null
+++ b/LayoutTests/fast/forms/number/number-setvalueforuser-skip-spaces.html
@@ -0,0 +1,40 @@
+<html>
tkent 2014/04/16 01:52:51 The test name is confusing. We have HTMLInputElem
gnana 2014/04/16 14:13:56 Done.
+<body>
+<script src="../../../resources/js-test.js"></script>
+<input type="number" id="input" style="width:300px; height:50px; padding-left: 10px; margin-bottom: 10px; border:1px solid green;"></input>
tkent 2014/04/16 01:52:51 The style attribute looks unnecessary.
gnana 2014/04/16 14:13:56 Done.
+<div>Printed Value: <span id="print">&nbsp;</span></div>
+<script>
+description('should print the input number removing space characters.');
+jsTestIsAsync = true;
+var input = document.getElementById('input');
+input.onblur = function() {
+ var inputValue = document.getElementById('input').valueAsNumber;
+ document.getElementById('print').innerHTML = inputValue;
tkent 2014/04/16 01:52:51 Wrong indentation.
gnana 2014/04/16 14:13:56 Done.
+ if (!isNaN(inputValue))
tkent 2014/04/16 01:52:51 We should check the specific value. shouldBeEqua
gnana 2014/04/16 14:13:56 Done.
+ testPassed('spaces skipped');
+}
+
+window.onload = function()
+{
+ var input = document.getElementById('input');
tkent 2014/04/16 01:52:51 This variable is redundant.
gnana 2014/04/16 14:13:56 Done.
+ if (!window.eventSender)
+ debug('Edit number input field with numbers & space. The test passes if "space are skipped" when printed.');
+ else {
+ input.focus();
+ eventSender.keyDown(" ");
tkent 2014/04/16 01:52:51 We don't need to use eventSender. document.execCo
gnana 2014/04/16 14:13:56 Done.
+ eventSender.keyDown("1");
+ eventSender.keyDown("2");
+ eventSender.keyDown("3");
+ eventSender.keyDown(" ");
+ eventSender.keyDown("4");
+ eventSender.keyDown("5");
+ eventSender.keyDown("6");
+ eventSender.keyDown(" ");
+ input.blur();
+ finishJSTest();
+ }
+}
+</script>
+</body>
+</html>
+

Powered by Google App Engine
This is Rietveld 408576698