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 bca74728c429c78821550673cb81505b3967ea33..b264896ade9db276ecbb769138c3b15ada7153f4 100644 |
--- a/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp |
+++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp |
@@ -7,6 +7,7 @@ |
#include "core/MediaTypeNames.h" |
#include "core/css/MediaList.h" |
#include "core/css/MediaValuesCached.h" |
+#include "core/css/MediaValuesInitialViewport.h" |
#include "core/frame/FrameView.h" |
#include "core/testing/DummyPageHolder.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -213,4 +214,18 @@ TEST(MediaQueryEvaluatorTest, CachedFloatViewportNonFloatFriendly) { |
testMQEvaluator(floatNonFriendlyViewportTestCases, mediaQueryEvaluator); |
} |
+TEST(MediaQueryEvaluatorTest, InitialViewport) { |
+ std::unique_ptr<DummyPageHolder> pageHolder = |
+ DummyPageHolder::create(IntSize(500, 500)); |
+ pageHolder->frameView().setMediaType(MediaTypeNames::screen); |
+ pageHolder->frameView().setLayoutSizeFixedToFrameSize(false); |
+ pageHolder->frameView().setInitialViewportSize(IntSize(500, 500)); |
+ pageHolder->frameView().setLayoutSize(IntSize(800, 800)); |
+ pageHolder->frameView().setFrameRect(IntRect(0, 0, 800, 800)); |
+ |
+ MediaQueryEvaluator mediaQueryEvaluator( |
+ MediaValuesInitialViewport::create(pageHolder->frame())); |
+ testMQEvaluator(viewportTestCases, mediaQueryEvaluator); |
+} |
+ |
} // namespace blink |