| Index: third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp b/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp
|
| index 6770c7e4d7155579b1ce622d917d7b1d6e30b481..25ee2ce726fc27c3786f07e45e45df8198d70f64 100644
|
| --- a/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp
|
| +++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp
|
| @@ -92,6 +92,30 @@ TestCase viewportTestCases[] = {
|
| {0, 0} // Do not remove the terminator line.
|
| };
|
|
|
| +TestCase floatViewportTestCases[] = {
|
| + {"all and (min-width: 600.5px)", 1},
|
| + {"(min-width: 600px)", 1},
|
| + {"(min-width: 600.5px)", 1},
|
| + {"(min-width: 601px)", 0},
|
| + {"(max-width: 600px)", 0},
|
| + {"(max-width: 600.5px)", 1},
|
| + {"(max-width: 601px)", 1},
|
| + {"(width: 600.5px)", 1},
|
| + {"(width: 601px)", 0},
|
| + {"(min-height: 700px)", 1},
|
| + {"(min-height: 700.125px)", 1},
|
| + {"(min-height: 701px)", 0},
|
| + {"(min-height: 700.126px)", 0},
|
| + {"(max-height: 701px)", 1},
|
| + {"(max-height: 700.125px)", 1},
|
| + {"(max-height: 700px)", 0},
|
| + {"(height: 700.125px)", 1},
|
| + {"(height: 700.126px)", 0},
|
| + {"(height: 700.124px)", 0},
|
| + {"(height: 701px)", 0},
|
| + {0, 0} // Do not remove the terminator line.
|
| +};
|
| +
|
| TestCase printTestCases[] = {
|
| {"print and (min-resolution: 1dppx)", 1},
|
| {"print and (min-resolution: 118dpcm)", 1},
|
| @@ -159,4 +183,15 @@ TEST(MediaQueryEvaluatorTest, DynamicNoView)
|
| EXPECT_FALSE(mediaQueryEvaluator.eval(querySet.get()));
|
| }
|
|
|
| +TEST(MediaQueryEvaluatorTest, CachedFloatViewport)
|
| +{
|
| + MediaValuesCached::MediaValuesCachedData data;
|
| + data.viewportWidth = 600.5;
|
| + data.viewportHeight = 700.125;
|
| + RefPtrWillBeRawPtr<MediaValues> mediaValues = MediaValuesCached::create(data);
|
| +
|
| + MediaQueryEvaluator mediaQueryEvaluator(*mediaValues);
|
| + testMQEvaluator(floatViewportTestCases, mediaQueryEvaluator);
|
| +}
|
| +
|
| } // namespace
|
|
|