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

Side by Side Diff: Source/core/css/MediaQueryEvaluatorTest.cpp

Issue 227043007: CSS Length calculation with MediaValues (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sizes_parser3
Patch Set: Fix debug compile issue 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 unified diff | Download patch
« no previous file with comments | « Source/core/css/MediaQueryEvaluator.cpp ('k') | Source/core/css/MediaValues.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/MediaQueryEvaluator.h" 6 #include "core/css/MediaQueryEvaluator.h"
7 7
8 #include "core/css/MediaList.h" 8 #include "core/css/MediaList.h"
9 #include "core/css/MediaValues.h" 9 #include "core/css/MediaValues.h"
10 #include "wtf/PassOwnPtr.h" 10 #include "wtf/PassOwnPtr.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 RefPtr<MediaValues> mediaValues = MediaValues::create(MediaValues::CachingMo de, 71 RefPtr<MediaValues> mediaValues = MediaValues::create(MediaValues::CachingMo de,
72 500, // Viewport Width 72 500, // Viewport Width
73 500, // Viewport height 73 500, // Viewport height
74 500, // Device Width 74 500, // Device Width
75 500, // Device Height 75 500, // Device Height
76 2.0, // Device pixel ratio 76 2.0, // Device pixel ratio
77 24, // Color bits per component 77 24, // Color bits per component
78 0, // Monochrome bits per component 78 0, // Monochrome bits per component
79 MediaValues::MousePointer, // Pointer device 79 MediaValues::MousePointer, // Pointer device
80 16, // Default font size 80 16, // Default font size
81 16, // Computed font size
82 false, // Has X height?
83 16, // Font x Height
84 16, // Font zero width
81 true, // 3D enabled 85 true, // 3D enabled
82 false, // scan media type 86 false, // scan media type
83 true, // screen media type 87 true, // screen media type
84 false, // print media type 88 false, // print media type
85 true // Strict mode 89 true, // Strict mode
90 1.0 // effective zoom
86 ); 91 );
87 92
88 for (unsigned i = 0; screenTestCases[i].input; ++i) { 93 for (unsigned i = 0; screenTestCases[i].input; ++i) {
89 RefPtrWillBeRawPtr<MediaQuerySet> querySet = MediaQuerySet::create(scree nTestCases[i].input); 94 RefPtrWillBeRawPtr<MediaQuerySet> querySet = MediaQuerySet::create(scree nTestCases[i].input);
90 MediaQueryEvaluator mediaQueryEvaluator("screen", *mediaValues); 95 MediaQueryEvaluator mediaQueryEvaluator("screen", *mediaValues);
91 ASSERT_EQ(screenTestCases[i].output, mediaQueryEvaluator.eval(querySet.g et())); 96 ASSERT_EQ(screenTestCases[i].output, mediaQueryEvaluator.eval(querySet.g et()));
92 } 97 }
93 for (unsigned i = 0; printTestCases[i].input; ++i) { 98 for (unsigned i = 0; printTestCases[i].input; ++i) {
94 RefPtrWillBeRawPtr<MediaQuerySet> querySet = MediaQuerySet::create(print TestCases[i].input); 99 RefPtrWillBeRawPtr<MediaQuerySet> querySet = MediaQuerySet::create(print TestCases[i].input);
95 MediaQueryEvaluator mediaQueryEvaluator("print", *mediaValues); 100 MediaQueryEvaluator mediaQueryEvaluator("print", *mediaValues);
96 ASSERT_EQ(printTestCases[i].output, mediaQueryEvaluator.eval(querySet.ge t())); 101 ASSERT_EQ(printTestCases[i].output, mediaQueryEvaluator.eval(querySet.ge t()));
97 } 102 }
98 } 103 }
99 104
100 } // namespace 105 } // namespace
OLDNEW
« no previous file with comments | « Source/core/css/MediaQueryEvaluator.cpp ('k') | Source/core/css/MediaValues.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698