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

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

Issue 2068053002: Rename Blink constants generated from IDL files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/CSSPageRule.h" 5 #include "core/css/CSSPageRule.h"
6 6
7 #include "core/css/CSSRuleList.h" 7 #include "core/css/CSSRuleList.h"
8 #include "core/css/CSSTestHelper.h" 8 #include "core/css/CSSTestHelper.h"
9 9
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 TEST(CSSPageRule, Serializing) 14 TEST(CSSPageRule, Serializing)
15 { 15 {
16 CSSTestHelper helper; 16 CSSTestHelper helper;
17 17
18 const char* cssRule = "@page :left { size: auto; }"; 18 const char* cssRule = "@page :left { size: auto; }";
19 helper.addCSSRules(cssRule); 19 helper.addCSSRules(cssRule);
20 if (helper.cssRules()) { 20 if (helper.cssRules()) {
21 EXPECT_EQ(1u, helper.cssRules()->length()); 21 EXPECT_EQ(1u, helper.cssRules()->length());
22 EXPECT_EQ(String(cssRule), helper.cssRules()->item(0)->cssText()); 22 EXPECT_EQ(String(cssRule), helper.cssRules()->item(0)->cssText());
23 EXPECT_EQ(CSSRule::PAGE_RULE, helper.cssRules()->item(0)->type()); 23 EXPECT_EQ(CSSRule::kPageRule, helper.cssRules()->item(0)->type());
24 if (CSSPageRule* pageRule = toCSSPageRule(helper.cssRules()->item(0))) 24 if (CSSPageRule* pageRule = toCSSPageRule(helper.cssRules()->item(0)))
25 EXPECT_EQ(":left", pageRule->selectorText()); 25 EXPECT_EQ(":left", pageRule->selectorText());
26 } 26 }
27 } 27 }
28 28
29 TEST(CSSPageRule, selectorText) 29 TEST(CSSPageRule, selectorText)
30 { 30 {
31 CSSTestHelper helper; 31 CSSTestHelper helper;
32 32
33 const char* cssRule = "@page :left { size: auto; }"; 33 const char* cssRule = "@page :left { size: auto; }";
(...skipping 15 matching lines...) Expand all
49 // set page pseudo class selector. 49 // set page pseudo class selector.
50 pageRule->setSelectorText(":right"); 50 pageRule->setSelectorText(":right");
51 EXPECT_EQ(":right", pageRule->selectorText()); 51 EXPECT_EQ(":right", pageRule->selectorText());
52 52
53 // set page type selector. 53 // set page type selector.
54 pageRule->setSelectorText("namedpage"); 54 pageRule->setSelectorText("namedpage");
55 EXPECT_EQ("namedpage", pageRule->selectorText()); 55 EXPECT_EQ("namedpage", pageRule->selectorText());
56 } 56 }
57 57
58 } // namespace blink 58 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSPageRule.h ('k') | third_party/WebKit/Source/core/css/CSSRule.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698