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 "config.h" | 5 #include "config.h" |
6 #include "core/css/MediaQueryEvaluator.h" | 6 #include "core/css/MediaQueryEvaluator.h" |
7 | 7 |
8 #include "core/MediaTypeNames.h" | 8 #include "core/MediaTypeNames.h" |
9 #include "core/css/MediaList.h" | 9 #include "core/css/MediaList.h" |
10 #include "core/css/MediaValuesCached.h" | 10 #include "core/css/MediaValuesCached.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 data.devicePixelRatio = 2.0; | 119 data.devicePixelRatio = 2.0; |
120 data.colorBitsPerComponent = 24; | 120 data.colorBitsPerComponent = 24; |
121 data.monochromeBitsPerComponent = 0; | 121 data.monochromeBitsPerComponent = 0; |
122 data.primaryPointerType = PointerTypeFine; | 122 data.primaryPointerType = PointerTypeFine; |
123 data.primaryHoverType = HoverTypeHover; | 123 data.primaryHoverType = HoverTypeHover; |
124 data.defaultFontSize = 16; | 124 data.defaultFontSize = 16; |
125 data.threeDEnabled = true; | 125 data.threeDEnabled = true; |
126 data.mediaType = MediaTypeNames::screen; | 126 data.mediaType = MediaTypeNames::screen; |
127 data.strictMode = true; | 127 data.strictMode = true; |
128 data.displayMode = WebDisplayModeBrowser; | 128 data.displayMode = WebDisplayModeBrowser; |
129 RefPtr<MediaValues> mediaValues = MediaValuesCached::create(data); | 129 RefPtrWillBeRawPtr<MediaValues> mediaValues = MediaValuesCached::create(data
); |
130 | 130 |
131 MediaQueryEvaluator mediaQueryEvaluator(*mediaValues); | 131 MediaQueryEvaluator mediaQueryEvaluator(*mediaValues); |
132 testMQEvaluator(screenTestCases, mediaQueryEvaluator); | 132 testMQEvaluator(screenTestCases, mediaQueryEvaluator); |
133 testMQEvaluator(viewportTestCases, mediaQueryEvaluator); | 133 testMQEvaluator(viewportTestCases, mediaQueryEvaluator); |
134 | 134 |
135 data.mediaType = MediaTypeNames::print; | 135 data.mediaType = MediaTypeNames::print; |
136 mediaValues = MediaValuesCached::create(data); | 136 mediaValues = MediaValuesCached::create(data); |
137 MediaQueryEvaluator printMediaQueryEvaluator(*mediaValues); | 137 MediaQueryEvaluator printMediaQueryEvaluator(*mediaValues); |
138 testMQEvaluator(printTestCases, printMediaQueryEvaluator); | 138 testMQEvaluator(printTestCases, printMediaQueryEvaluator); |
139 } | 139 } |
(...skipping 14 matching lines...) Expand all Loading... |
154 OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(500, 50
0)); | 154 OwnPtr<DummyPageHolder> pageHolder = DummyPageHolder::create(IntSize(500, 50
0)); |
155 RefPtrWillBeRawPtr<LocalFrame> frame = &pageHolder->frame(); | 155 RefPtrWillBeRawPtr<LocalFrame> frame = &pageHolder->frame(); |
156 pageHolder.clear(); | 156 pageHolder.clear(); |
157 ASSERT_EQ(nullptr, frame->view()); | 157 ASSERT_EQ(nullptr, frame->view()); |
158 MediaQueryEvaluator mediaQueryEvaluator(frame.get()); | 158 MediaQueryEvaluator mediaQueryEvaluator(frame.get()); |
159 RefPtrWillBeRawPtr<MediaQuerySet> querySet = MediaQuerySet::create("foobar")
; | 159 RefPtrWillBeRawPtr<MediaQuerySet> querySet = MediaQuerySet::create("foobar")
; |
160 EXPECT_FALSE(mediaQueryEvaluator.eval(querySet.get())); | 160 EXPECT_FALSE(mediaQueryEvaluator.eval(querySet.get())); |
161 } | 161 } |
162 | 162 |
163 } // namespace | 163 } // namespace |
OLD | NEW |