| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |