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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/html/HTMLInputElement.h" 5 #include "core/html/HTMLInputElement.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/frame/FrameHost.h" 8 #include "core/frame/FrameHost.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/VisualViewport.h" 10 #include "core/frame/VisualViewport.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 document().view()->updateAllLifecyclePhases(); 155 document().view()->updateAllLifecyclePhases();
156 HTMLInputElement* input = toHTMLInputElement(document().body()->firstChild()); 156 HTMLInputElement* input = toHTMLInputElement(document().body()->firstChild());
157 157
158 DateTimeChooserParameters params; 158 DateTimeChooserParameters params;
159 bool success = input->setupDateTimeChooserParameters(params); 159 bool success = input->setupDateTimeChooserParameters(params);
160 EXPECT_TRUE(success); 160 EXPECT_TRUE(success);
161 EXPECT_EQ("date", params.type); 161 EXPECT_EQ("date", params.type);
162 EXPECT_EQ(IntRect(16, 16, 400, 100), params.anchorRectInScreen); 162 EXPECT_EQ(IntRect(16, 16, 400, 100), params.anchorRectInScreen);
163 } 163 }
164 164
165 TEST_F(HTMLInputElementTest, StepDownOverflow) {
166 HTMLInputElement* input = HTMLInputElement::create(document(), false);
167 input->setAttribute(HTMLNames::typeAttr, "date");
168 input->setAttribute(HTMLNames::minAttr, "2010-02-10");
169 input->setAttribute(HTMLNames::stepAttr, "9223372036854775556");
170 // InputType::applyStep() should not pass an out-of-range value to
171 // setValueAsDecimal, and WTF::msToYear() should not cause a DCHECK failure.
172 input->stepDown(1, ASSERT_NO_EXCEPTION);
173 }
174
165 } // namespace blink 175 } // namespace blink
OLDNEW
« 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