| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/forms/StepRange.h" | 5 #include "core/html/forms/StepRange.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| 11 TEST(StepRangeTest, ClampValueWithOutStepMatchedValue) | 11 TEST(StepRangeTest, ClampValueWithOutStepMatchedValue) |
| 12 { | 12 { |
| 13 // <input type=range value=200 min=0 max=100 step=1000> | 13 // <input type=range value=200 min=0 max=100 step=1000> |
| 14 StepRange stepRange(Decimal(200), Decimal(0), Decimal(100), Decimal(1000), S
tepRange::StepDescription()); | 14 StepRange stepRange(Decimal(200), Decimal(0), Decimal(100), true, Decimal(10
00), StepRange::StepDescription()); |
| 15 | 15 |
| 16 EXPECT_EQ(Decimal(100), stepRange.clampValue(Decimal(200))); | 16 EXPECT_EQ(Decimal(100), stepRange.clampValue(Decimal(200))); |
| 17 EXPECT_EQ(Decimal(0), stepRange.clampValue(Decimal(-100))); | 17 EXPECT_EQ(Decimal(0), stepRange.clampValue(Decimal(-100))); |
| 18 } | 18 } |
| 19 | 19 |
| 20 } // namespace blink | 20 } // namespace blink |
| OLD | NEW |