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

Side by Side Diff: third_party/WebKit/Source/core/html/forms/StepRangeTest.cpp

Issue 2033323002: :in-range and :out-of-range CSS selectors should check 'have range limitations.' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « third_party/WebKit/Source/core/html/forms/StepRange.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/StepRange.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698