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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/MediaConditionTest.cpp

Issue 2873433003: Move MediaQuery classes off BlinkGC heap (Closed)
Patch Set: Created 3 years, 7 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 "core/css/MediaList.h" 5 #include "core/css/MediaList.h"
6 #include "core/css/MediaQuery.h" 6 #include "core/css/MediaQuery.h"
7 #include "core/css/parser/CSSTokenizer.h" 7 #include "core/css/parser/CSSTokenizer.h"
8 #include "core/css/parser/MediaQueryParser.h" 8 #include "core/css/parser/MediaQueryParser.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "wtf/text/StringBuilder.h" 10 #include "wtf/text/StringBuilder.h"
(...skipping 20 matching lines...) Expand all
31 "(max-width: 900px) and (min-width: 100px)"}, 31 "(max-width: 900px) and (min-width: 100px)"},
32 {"(min-width: [100px) and (max-width: 900px)", "not all"}, 32 {"(min-width: [100px) and (max-width: 900px)", "not all"},
33 {"not (min-width: 900px)", "not all and (min-width: 900px)"}, 33 {"not (min-width: 900px)", "not all and (min-width: 900px)"},
34 {"not (blabla)", "not all"}, 34 {"not (blabla)", "not all"},
35 {0, 0} // Do not remove the terminator line. 35 {0, 0} // Do not remove the terminator line.
36 }; 36 };
37 37
38 // FIXME: We should test comma-seperated media conditions 38 // FIXME: We should test comma-seperated media conditions
39 for (unsigned i = 0; testCases[i].input; ++i) { 39 for (unsigned i = 0; testCases[i].input; ++i) {
40 CSSTokenizer tokenizer(testCases[i].input); 40 CSSTokenizer tokenizer(testCases[i].input);
41 MediaQuerySet* mediaConditionQuerySet = 41 RefPtr<MediaQuerySet> mediaConditionQuerySet =
42 MediaQueryParser::parseMediaCondition(tokenizer.tokenRange()); 42 MediaQueryParser::parseMediaCondition(tokenizer.tokenRange());
43 ASSERT_EQ(mediaConditionQuerySet->queryVector().size(), (unsigned)1); 43 ASSERT_EQ(mediaConditionQuerySet->queryVector().size(), (unsigned)1);
44 String queryText = mediaConditionQuerySet->queryVector()[0]->cssText(); 44 String queryText = mediaConditionQuerySet->queryVector()[0]->cssText();
45 ASSERT_STREQ(testCases[i].output, queryText.ascii().data()); 45 ASSERT_STREQ(testCases[i].output, queryText.ascii().data());
46 } 46 }
47 } 47 }
48 48
49 } // namespace blink 49 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/StyleRuleImport.cpp ('k') | third_party/WebKit/Source/core/css/parser/MediaQueryParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698