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

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

Issue 1444173002: third_party/WebKit: fix typos found in comments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 ASSERT_EQ(str, rules->at(0).selector().tagQName().localName()); 72 ASSERT_EQ(str, rules->at(0).selector().tagQName().localName());
73 } 73 }
74 74
75 TEST(RuleSetTest, findBestRuleSetAndAdd_ClassThenId) 75 TEST(RuleSetTest, findBestRuleSetAndAdd_ClassThenId)
76 { 76 {
77 CSSTestHelper helper; 77 CSSTestHelper helper;
78 78
79 helper.addCSSRules(".class#id { }"); 79 helper.addCSSRules(".class#id { }");
80 RuleSet& ruleSet = helper.ruleSet(); 80 RuleSet& ruleSet = helper.ruleSet();
81 AtomicString str("id"); 81 AtomicString str("id");
82 // id is prefered over class even if class preceeds it in the selector. 82 // id is preferred over class even if class precedes it in the selector.
83 const TerminatedArray<RuleData>* rules = ruleSet.idRules(str); 83 const TerminatedArray<RuleData>* rules = ruleSet.idRules(str);
84 ASSERT_EQ(1u, rules->size()); 84 ASSERT_EQ(1u, rules->size());
85 AtomicString classStr("class"); 85 AtomicString classStr("class");
86 ASSERT_EQ(classStr, rules->at(0).selector().value()); 86 ASSERT_EQ(classStr, rules->at(0).selector().value());
87 } 87 }
88 88
89 TEST(RuleSetTest, findBestRuleSetAndAdd_IdThenClass) 89 TEST(RuleSetTest, findBestRuleSetAndAdd_IdThenClass)
90 { 90 {
91 CSSTestHelper helper; 91 CSSTestHelper helper;
92 92
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 { 205 {
206 CSSTestHelper helper; 206 CSSTestHelper helper;
207 207
208 helper.addCSSRules(".foo:host-context(*) { }"); 208 helper.addCSSRules(".foo:host-context(*) { }");
209 RuleSet& ruleSet = helper.ruleSet(); 209 RuleSet& ruleSet = helper.ruleSet();
210 const WillBeHeapVector<RuleData>* rules = ruleSet.shadowHostRules(); 210 const WillBeHeapVector<RuleData>* rules = ruleSet.shadowHostRules();
211 ASSERT_EQ(0u, rules->size()); 211 ASSERT_EQ(0u, rules->size());
212 } 212 }
213 213
214 } // namespace blink 214 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698