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

Side by Side Diff: sky/engine/core/css/CSSSelectorTest.cpp

Issue 809513003: Remove dead methods from CSSStyleSheet and StyleSheetContents. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « no previous file | sky/engine/core/css/CSSStyleSheet.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "sky/engine/config.h"
6 #include "sky/engine/core/css/CSSTestHelper.h"
7 #include "sky/engine/core/css/RuleSet.h"
8
9 #include <gtest/gtest.h>
10
11 namespace blink {
12
13 TEST(CSSSelector, Representations)
14 {
15 CSSTestHelper helper;
16
17 const char* cssRules =
18 "summary::-webkit-details-marker { }"
19 "* {}"
20 "div {}"
21 "#id {}"
22 ".class {}"
23 "[attr] {}"
24 "div:hover {}"
25 "div:nth-child(2){}"
26 ".class#id { }"
27 "#id.class { }"
28 "[attr]#id { }"
29 "div[attr]#id { }"
30 "div::content { }"
31 "div::first-line { }"
32 ".a.b.c { }"
33 "div:not(.a) { }" // without class a
34 "div:not(:visited) { }" // without the visited pseudo class
35
36 "[attr=\"value\"] { }" // Exact equality
37 "[attr~=\"value\"] { }" // One of a space-separated list
38 "[attr^=\"value\"] { }" // Begins with
39 "[attr$=\"value\"] { }" // Ends with
40 "[attr*=\"value\"] { }" // Substring equal to
41 "[attr|=\"value\"] { }" // One of a hyphen-separated list
42
43 ".a .b { }" // .b is a descendant of .a
44 ".a > .b { }" // .b is a direct descendant of .a
45 ".a ~ .b { }" // .a precedes .b in sibling order
46 ".a + .b { }" // .a element immediately precedes .b in sibling order
47 ".a, .b { }" // matches .a or .b
48
49 ".a.b .c {}";
50
51 helper.addCSSRules(cssRules);
52 EXPECT_EQ(30u, helper.ruleSet().ruleCount()); // .a, .b counts as two rules.
53 #ifndef NDEBUG
54 helper.ruleSet().show();
55 #endif
56 }
57
58 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/css/CSSStyleSheet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698