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

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

Issue 240453010: Avoid use of CSSValue in MediaQueryExp and MediaQueryEvaluator (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix previous patch 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/MediaQueryExp.cpp ('k') | Source/core/css/parser/MediaQueryToken.cpp » ('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/MediaQuery.h" 6 #include "core/css/MediaQuery.h"
7 7
8 #include "core/css/MediaList.h" 8 #include "core/css/MediaList.h"
9 #include "wtf/PassOwnPtr.h" 9 #include "wtf/PassOwnPtr.h"
10 #include "wtf/text/StringBuilder.h" 10 #include "wtf/text/StringBuilder.h"
(...skipping 21 matching lines...) Expand all
32 output.append(", "); 32 output.append(", ");
33 } 33 }
34 if (!oldParser || test.shouldWorkOnOldParser) { 34 if (!oldParser || test.shouldWorkOnOldParser) {
35 if (test.output) 35 if (test.output)
36 ASSERT_STREQ(test.output, output.toString().ascii().data()); 36 ASSERT_STREQ(test.output, output.toString().ascii().data());
37 else 37 else
38 ASSERT_STREQ(test.input, output.toString().ascii().data()); 38 ASSERT_STREQ(test.input, output.toString().ascii().data());
39 } 39 }
40 } 40 }
41 41
42 TEST(MediaQueryParserTest, Basic) 42 TEST(MediaQuerySetTest, Basic)
43 { 43 {
44 // The first string represents the input string. 44 // The first string represents the input string.
45 // The second string represents the output string, if present. 45 // The second string represents the output string, if present.
46 // Otherwise, the output string is identical to the first string. 46 // Otherwise, the output string is identical to the first string.
47 TestCase testCases[] = { 47 TestCase testCases[] = {
48 {"", 0, true}, 48 {"", 0, true},
49 {" ", "", true}, 49 {" ", "", true},
50 {"screen", 0, true}, 50 {"screen", 0, true},
51 {"screen and (color)", 0, true}, 51 {"screen and (color)", 0, true},
52 {"all and (min-width:500px)", "(min-width: 500px)", true}, 52 {"all and (min-width:500px)", "(min-width: 500px)", true},
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 for (unsigned i = 0; testCases[i].input; ++i) { 163 for (unsigned i = 0; testCases[i].input; ++i) {
164 RefPtrWillBeRawPtr<MediaQuerySet> oldParserQuerySet = MediaQuerySet::cre ate(testCases[i].input); 164 RefPtrWillBeRawPtr<MediaQuerySet> oldParserQuerySet = MediaQuerySet::cre ate(testCases[i].input);
165 RefPtrWillBeRawPtr<MediaQuerySet> threadSafeQuerySet = MediaQuerySet::cr eateOffMainThread(testCases[i].input); 165 RefPtrWillBeRawPtr<MediaQuerySet> threadSafeQuerySet = MediaQuerySet::cr eateOffMainThread(testCases[i].input);
166 testMediaQuery(testCases[i], *oldParserQuerySet, true); 166 testMediaQuery(testCases[i], *oldParserQuerySet, true);
167 testMediaQuery(testCases[i], *threadSafeQuerySet, false); 167 testMediaQuery(testCases[i], *threadSafeQuerySet, false);
168 } 168 }
169 } 169 }
170 170
171 } // namespace 171 } // namespace
OLDNEW
« no previous file with comments | « Source/core/css/MediaQueryExp.cpp ('k') | Source/core/css/parser/MediaQueryToken.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698