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

Unified Diff: Source/core/css/MediaQueryEvaluatorTest.cpp

Issue 224733011: A sizes attribute parser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed rebase Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/MediaQueryEvaluator.cpp ('k') | Source/core/css/MediaQueryExp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/MediaQueryEvaluatorTest.cpp
diff --git a/Source/core/css/MediaQueryEvaluatorTest.cpp b/Source/core/css/MediaQueryEvaluatorTest.cpp
index 3d0d07d8ef2f84d63cf8e36caf55f3b81d407c61..90ab2ce9e659eee2b8adfd808e09830a9e2107d1 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,23 @@ 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
- );
+ MediaValuesCached::MediaValuesCachedData data;
+ data.viewportWidth = 500;
+ data.viewportHeight = 500;
+ data.deviceWidth = 500;
+ data.deviceHeight = 500;
+ data.devicePixelRatio = 2.0;
+ data.colorBitsPerComponent = 24;
+ data.monochromeBitsPerComponent = 0;
+ data.pointer = MediaValues::MousePointer;
+ data.defaultFontSize = 16;
+ data.computedFontSize = 16;
+ data.threeDEnabled = true;
+ data.scanMediaType = false;
+ data.screenMediaType = true;
+ data.printMediaType = false;
+ data.strictMode = true;
+ RefPtr<MediaValues> mediaValues = MediaValuesCached::create(data);
for (unsigned i = 0; screenTestCases[i].input; ++i) {
RefPtrWillBeRawPtr<MediaQuerySet> querySet = MediaQuerySet::create(screenTestCases[i].input);
« no previous file with comments | « Source/core/css/MediaQueryEvaluator.cpp ('k') | Source/core/css/MediaQueryExp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698