OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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 "core/css/CSSPageRule.h" | |
6 | |
7 #include "core/css/CSSRuleList.h" | |
8 #include "core/css/CSSTestHelper.h" | |
9 | |
10 #include "testing/gtest/include/gtest/gtest.h" | |
11 | |
12 namespace blink { | |
13 | |
14 TEST(CSSPageRule, Serializing) | |
15 { | |
16 CSSTestHelper helper; | |
17 | |
18 const char* cssRule = "@page :left { size: auto; }"; | |
19 helper.addCSSRules(cssRule); | |
20 if (helper.cssRules()) { | |
Timothy Loh
2016/01/31 23:54:24
If this ends up null for some reason, then the tes
| |
21 EXPECT_EQ(1u, helper.cssRules()->length()); | |
22 EXPECT_EQ(String(cssRule), helper.cssRules()->item(0)->cssText()); | |
23 EXPECT_EQ(CSSRule::PAGE_RULE, helper.cssRules()->item(0)->type()); | |
24 if (CSSPageRule* pageRule = toCSSPageRule(helper.cssRules()->item(0))) | |
25 EXPECT_EQ(":left", pageRule->selectorText()); | |
26 } | |
27 } | |
28 | |
29 } // namespace blink | |
OLD | NEW |