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

Unified Diff: third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp

Issue 2747173006: INPUT element: stepDown() should not try to set an out-of-bound value. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/forms/InputType.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp
index e6e8ffdb9a19fa9c3c05441d37403da56be4aeb1..72932387c5c92594cb8db8594eb172480792e134 100644
--- a/third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp
@@ -162,4 +162,14 @@ TEST_F(HTMLInputElementTest, DateTimeChooserSizeParamRespectsScale) {
EXPECT_EQ(IntRect(16, 16, 400, 100), params.anchorRectInScreen);
}
+TEST_F(HTMLInputElementTest, StepDownOverflow) {
+ HTMLInputElement* input = HTMLInputElement::create(document(), false);
+ input->setAttribute(HTMLNames::typeAttr, "date");
+ input->setAttribute(HTMLNames::minAttr, "2010-02-10");
+ input->setAttribute(HTMLNames::stepAttr, "9223372036854775556");
+ // InputType::applyStep() should not pass an out-of-range value to
+ // setValueAsDecimal, and WTF::msToYear() should not cause a DCHECK failure.
+ input->stepDown(1, ASSERT_NO_EXCEPTION);
+}
+
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/forms/InputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698