Index: Source/core/css/MediaQueryEvaluatorTest.cpp |
diff --git a/Source/core/css/MediaQueryEvaluatorTest.cpp b/Source/core/css/MediaQueryEvaluatorTest.cpp |
index 3d0d07d8ef2f84d63cf8e36caf55f3b81d407c61..997a7760a07ba1413e6e2c5a430e366ad399627a 100644 |
--- a/Source/core/css/MediaQueryEvaluatorTest.cpp |
+++ b/Source/core/css/MediaQueryEvaluatorTest.cpp |
@@ -6,7 +6,7 @@ |
#include "core/css/MediaQueryEvaluator.h" |
#include "core/css/MediaList.h" |
-#include "core/css/MediaValues.h" |
+#include "core/css/MediaValuesCached.h" |
#include "wtf/PassOwnPtr.h" |
#include "wtf/text/StringBuilder.h" |
@@ -25,6 +25,8 @@ TEST(MediaQueryEvaluatorTest, Basic) |
// The second string represents the output string, if present. |
// Otherwise, the output string is identical to the first string. |
TestCase screenTestCases[] = { |
+ {"", 1}, |
+ {" ", 1}, |
{"screen", 1}, |
{"screen and (color)", 1}, |
{"all and (min-width: 500px)", 1}, |
@@ -68,22 +70,26 @@ TEST(MediaQueryEvaluatorTest, Basic) |
{0, 0} // Do not remove the terminator line. |
}; |
- RefPtr<MediaValues> mediaValues = MediaValues::create(MediaValues::CachingMode, |
- 500, // Viewport Width |
- 500, // Viewport height |
- 500, // Device Width |
- 500, // Device Height |
- 2.0, // Device pixel ratio |
- 24, // Color bits per component |
- 0, // Monochrome bits per component |
- MediaValues::MousePointer, // Pointer device |
- 16, // Default font size |
- true, // 3D enabled |
- false, // scan media type |
- true, // screen media type |
- false, // print media type |
- true // Strict mode |
- ); |
+ MediaValues::MediaValuesInitializer initializer; |
eseidel
2014/04/14 22:55:32
This is sooooo much easier to read /less error pro
|
+ initializer.viewportWidth = 500; |
+ initializer.viewportHeight = 500; |
+ initializer.deviceWidth = 500; |
+ initializer.deviceHeight = 500; |
+ initializer.devicePixelRatio = 2.0; |
+ initializer.colorBitsPerComponent = 24; |
+ initializer.monochromeBitsPerComponent = 0; |
+ initializer.pointer = MediaValues::MousePointer; |
+ initializer.defaultFontSize = 16; |
+ initializer.computedFontSize = 16; |
+ initializer.hasXHeight = true; |
+ initializer.xHeight = 16; |
+ initializer.zeroWidth = 16; |
+ initializer.threeDEnabled = true; |
+ initializer.scanMediaType = false; |
+ initializer.screenMediaType = true; |
+ initializer.printMediaType = false; |
+ initializer.strictMode = true; |
+ RefPtr<MediaValues> mediaValues = MediaValuesCached::create(initializer); |
for (unsigned i = 0; screenTestCases[i].input; ++i) { |
RefPtrWillBeRawPtr<MediaQuerySet> querySet = MediaQuerySet::create(screenTestCases[i].input); |