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/parser/SizesCalcParser.h" | 6 #include "core/css/parser/SizesCalcParser.h" |
7 | 7 |
8 #include "core/MediaTypeNames.h" | 8 #include "core/MediaTypeNames.h" |
9 #include "core/css/CSSPrimitiveValue.h" | 9 #include "core/css/CSSPrimitiveValue.h" |
10 #include "core/css/MediaValuesCached.h" | 10 #include "core/css/MediaValuesCached.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 data.deviceHeight = 643; | 107 data.deviceHeight = 643; |
108 data.devicePixelRatio = 2.0; | 108 data.devicePixelRatio = 2.0; |
109 data.colorBitsPerComponent = 24; | 109 data.colorBitsPerComponent = 24; |
110 data.monochromeBitsPerComponent = 0; | 110 data.monochromeBitsPerComponent = 0; |
111 data.primaryPointerType = PointerTypeFine; | 111 data.primaryPointerType = PointerTypeFine; |
112 data.defaultFontSize = 16; | 112 data.defaultFontSize = 16; |
113 data.threeDEnabled = true; | 113 data.threeDEnabled = true; |
114 data.mediaType = MediaTypeNames::screen; | 114 data.mediaType = MediaTypeNames::screen; |
115 data.strictMode = true; | 115 data.strictMode = true; |
116 data.displayMode = WebDisplayModeBrowser; | 116 data.displayMode = WebDisplayModeBrowser; |
117 RefPtr<MediaValues> mediaValues = MediaValuesCached::create(data); | 117 RefPtrWillBeRawPtr<MediaValues> mediaValues = MediaValuesCached::create(data
); |
118 | 118 |
119 for (unsigned i = 0; testCases[i].input; ++i) { | 119 for (unsigned i = 0; testCases[i].input; ++i) { |
120 SizesCalcParser calcParser(CSSTokenizer::Scope(testCases[i].input).token
Range(), mediaValues); | 120 SizesCalcParser calcParser(CSSTokenizer::Scope(testCases[i].input).token
Range(), mediaValues); |
121 ASSERT_EQ(testCases[i].valid, calcParser.isValid()); | 121 ASSERT_EQ(testCases[i].valid, calcParser.isValid()); |
122 if (calcParser.isValid()) | 122 if (calcParser.isValid()) |
123 ASSERT_EQ(testCases[i].output, calcParser.result()); | 123 ASSERT_EQ(testCases[i].output, calcParser.result()); |
124 } | 124 } |
125 | 125 |
126 for (unsigned i = 0; testCases[i].input; ++i) { | 126 for (unsigned i = 0; testCases[i].input; ++i) { |
127 if (testCases[i].dontRunInCSSCalc) | 127 if (testCases[i].dontRunInCSSCalc) |
128 continue; | 128 continue; |
129 verifyCSSCalc(testCases[i].input, testCases[i].output, testCases[i].vali
d, data.defaultFontSize, data.viewportWidth, data.viewportHeight); | 129 verifyCSSCalc(testCases[i].input, testCases[i].output, testCases[i].vali
d, data.defaultFontSize, data.viewportWidth, data.viewportHeight); |
130 } | 130 } |
131 } | 131 } |
132 | 132 |
133 } // namespace | 133 } // namespace |
OLD | NEW |