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

Side by Side Diff: Source/core/css/parser/SizesAttributeParserTest.cpp

Issue 335313003: MediaQueryEvaluator getting mediaType from MediaValues (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added a comment Created 6 years, 5 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 unified diff | Download patch
OLDNEW
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/parser/SizesAttributeParser.h" 6 #include "core/css/parser/SizesAttributeParser.h"
7 7
8 #include "core/MediaTypeNames.h"
8 #include "core/css/MediaValuesCached.h" 9 #include "core/css/MediaValuesCached.h"
9 10
10 #include <gtest/gtest.h> 11 #include <gtest/gtest.h>
11 12
12 namespace WebCore { 13 namespace WebCore {
13 14
14 typedef struct { 15 typedef struct {
15 const char* input; 16 const char* input;
16 const int output; 17 const int output;
17 } TestCase; 18 } TestCase;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 data.viewportWidth = 500; 61 data.viewportWidth = 500;
61 data.viewportHeight = 500; 62 data.viewportHeight = 500;
62 data.deviceWidth = 500; 63 data.deviceWidth = 500;
63 data.deviceHeight = 500; 64 data.deviceHeight = 500;
64 data.devicePixelRatio = 2.0; 65 data.devicePixelRatio = 2.0;
65 data.colorBitsPerComponent = 24; 66 data.colorBitsPerComponent = 24;
66 data.monochromeBitsPerComponent = 0; 67 data.monochromeBitsPerComponent = 0;
67 data.pointer = MediaValues::MousePointer; 68 data.pointer = MediaValues::MousePointer;
68 data.defaultFontSize = 16; 69 data.defaultFontSize = 16;
69 data.threeDEnabled = true; 70 data.threeDEnabled = true;
70 data.scanMediaType = false; 71 data.mediaType = MediaTypeNames::screen;
71 data.screenMediaType = true;
72 data.printMediaType = false;
73 data.strictMode = true; 72 data.strictMode = true;
74 RefPtr<MediaValues> mediaValues = MediaValuesCached::create(data); 73 RefPtr<MediaValues> mediaValues = MediaValuesCached::create(data);
75 74
76 for (unsigned i = 0; testCases[i].input; ++i) { 75 for (unsigned i = 0; testCases[i].input; ++i) {
77 int effectiveSize = SizesAttributeParser::findEffectiveSize(testCases[i] .input, mediaValues); 76 int effectiveSize = SizesAttributeParser::findEffectiveSize(testCases[i] .input, mediaValues);
78 ASSERT_EQ(testCases[i].output, effectiveSize); 77 ASSERT_EQ(testCases[i].output, effectiveSize);
79 } 78 }
80 } 79 }
81 80
82 } // namespace 81 } // namespace
OLDNEW
« no previous file with comments | « Source/core/css/parser/SizesAttributeParser.cpp ('k') | Source/core/css/parser/SizesCalcParserTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698