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

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

Issue 1574323003: Split compound selector after consume finished. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@upload-base
Patch Set: Removed obsolete serialization hack and fixed unit tests. Created 4 years, 11 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 /* 1 /*
2 * Copyright (c) 2014, Google Inc. All rights reserved. 2 * Copyright (c) 2014, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 TEST(RuleSetTest, findBestRuleSetAndAdd_DivWithContent) 125 TEST(RuleSetTest, findBestRuleSetAndAdd_DivWithContent)
126 { 126 {
127 CSSTestHelper helper; 127 CSSTestHelper helper;
128 128
129 helper.addCSSRules("div::content { }"); 129 helper.addCSSRules("div::content { }");
130 RuleSet& ruleSet = helper.ruleSet(); 130 RuleSet& ruleSet = helper.ruleSet();
131 AtomicString str("div"); 131 AtomicString str("div");
132 const TerminatedArray<RuleData>* rules = ruleSet.tagRules(str); 132 const TerminatedArray<RuleData>* rules = ruleSet.tagRules(str);
133 ASSERT_EQ(1u, rules->size()); 133 ASSERT_EQ(1u, rules->size());
134 AtomicString valueStr("content"); 134 AtomicString valueStr("content");
135 ASSERT_EQ(valueStr, rules->at(0).selector().value()); 135 ASSERT_EQ(valueStr, rules->at(0).selector().tagHistory()->value());
136 } 136 }
137 137
138 TEST(RuleSetTest, findBestRuleSetAndAdd_Host) 138 TEST(RuleSetTest, findBestRuleSetAndAdd_Host)
139 { 139 {
140 CSSTestHelper helper; 140 CSSTestHelper helper;
141 141
142 helper.addCSSRules(":host { }"); 142 helper.addCSSRules(":host { }");
143 RuleSet& ruleSet = helper.ruleSet(); 143 RuleSet& ruleSet = helper.ruleSet();
144 const WillBeHeapVector<RuleData>* rules = ruleSet.shadowHostRules(); 144 const WillBeHeapVector<RuleData>* rules = ruleSet.shadowHostRules();
145 ASSERT_EQ(1u, rules->size()); 145 ASSERT_EQ(1u, rules->size());
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 { 203 {
204 CSSTestHelper helper; 204 CSSTestHelper helper;
205 205
206 helper.addCSSRules(".foo:host-context(*) { }"); 206 helper.addCSSRules(".foo:host-context(*) { }");
207 RuleSet& ruleSet = helper.ruleSet(); 207 RuleSet& ruleSet = helper.ruleSet();
208 const WillBeHeapVector<RuleData>* rules = ruleSet.shadowHostRules(); 208 const WillBeHeapVector<RuleData>* rules = ruleSet.shadowHostRules();
209 ASSERT_EQ(0u, rules->size()); 209 ASSERT_EQ(0u, rules->size());
210 } 210 }
211 211
212 } // namespace blink 212 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleFeature.cpp ('k') | third_party/WebKit/Source/core/css/parser/CSSParserSelector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698