OLD | NEW |
---|---|
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 29 matching lines...) Expand all Loading... | |
40 CSSTestHelper helper; | 40 CSSTestHelper helper; |
41 | 41 |
42 helper.addCSSRules("summary::-webkit-details-marker { }"); | 42 helper.addCSSRules("summary::-webkit-details-marker { }"); |
43 RuleSet& ruleSet = helper.ruleSet(); | 43 RuleSet& ruleSet = helper.ruleSet(); |
44 AtomicString str("-webkit-details-marker"); | 44 AtomicString str("-webkit-details-marker"); |
45 const TerminatedArray<RuleData>* rules = ruleSet.shadowPseudoElementRules(st r); | 45 const TerminatedArray<RuleData>* rules = ruleSet.shadowPseudoElementRules(st r); |
46 ASSERT_EQ(1u, rules->size()); | 46 ASSERT_EQ(1u, rules->size()); |
47 ASSERT_EQ(str, rules->at(0).selector().value()); | 47 ASSERT_EQ(str, rules->at(0).selector().value()); |
48 } | 48 } |
49 | 49 |
50 TEST(RuleSetTest, findBestRuleSetAndAdd_MarkerElementNotAllowedInNonUAStyle) | |
51 { | |
52 CSSTestHelper helper; | |
53 | |
54 helper.tryAddCSSRules("li::marker { }"); | |
55 RuleSet& ruleSet = helper.ruleSet(); | |
56 AtomicString str("li"); | |
57 const TerminatedArray<RuleData>* rules = ruleSet.tagRules(str); | |
58 ASSERT_EQ(0u, rules->size()); | |
59 } | |
Julien - ping for review
2014/12/05 19:44:03
Only one unit test?
| |
60 | |
50 TEST(RuleSetTest, findBestRuleSetAndAdd_Id) | 61 TEST(RuleSetTest, findBestRuleSetAndAdd_Id) |
51 { | 62 { |
52 CSSTestHelper helper; | 63 CSSTestHelper helper; |
53 | 64 |
54 helper.addCSSRules("#id { }"); | 65 helper.addCSSRules("#id { }"); |
55 RuleSet& ruleSet = helper.ruleSet(); | 66 RuleSet& ruleSet = helper.ruleSet(); |
56 AtomicString str("id"); | 67 AtomicString str("id"); |
57 const TerminatedArray<RuleData>* rules = ruleSet.idRules(str); | 68 const TerminatedArray<RuleData>* rules = ruleSet.idRules(str); |
58 ASSERT_EQ(1u, rules->size()); | 69 ASSERT_EQ(1u, rules->size()); |
59 ASSERT_EQ(str, rules->at(0).selector().value()); | 70 ASSERT_EQ(str, rules->at(0).selector().value()); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 helper.addCSSRules("div::content { }"); | 141 helper.addCSSRules("div::content { }"); |
131 RuleSet& ruleSet = helper.ruleSet(); | 142 RuleSet& ruleSet = helper.ruleSet(); |
132 AtomicString str("div"); | 143 AtomicString str("div"); |
133 const TerminatedArray<RuleData>* rules = ruleSet.tagRules(str); | 144 const TerminatedArray<RuleData>* rules = ruleSet.tagRules(str); |
134 ASSERT_EQ(1u, rules->size()); | 145 ASSERT_EQ(1u, rules->size()); |
135 AtomicString valueStr("content"); | 146 AtomicString valueStr("content"); |
136 ASSERT_EQ(valueStr, rules->at(0).selector().value()); | 147 ASSERT_EQ(valueStr, rules->at(0).selector().value()); |
137 } | 148 } |
138 | 149 |
139 } // namespace blink | 150 } // namespace blink |
OLD | NEW |