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

Unified Diff: third_party/WebKit/Source/core/css/CSSPageRuleTest.cpp

Issue 1637273003: PageRule should not serialize @page in selectorText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win build problem Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSPageRule.cpp ('k') | third_party/WebKit/Source/core/css/CSSRule.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/CSSPageRuleTest.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSPageRuleTest.cpp b/third_party/WebKit/Source/core/css/CSSPageRuleTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..b19737f552e7489871c42728a351ee7a50c9e513
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/CSSPageRuleTest.cpp
@@ -0,0 +1,29 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/css/CSSPageRule.h"
+
+#include "core/css/CSSRuleList.h"
+#include "core/css/CSSTestHelper.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace blink {
+
+TEST(CSSPageRule, Serializing)
+{
+ CSSTestHelper helper;
+
+ const char* cssRule = "@page :left { size: auto; }";
+ helper.addCSSRules(cssRule);
+ if (helper.cssRules()) {
Timothy Loh 2016/01/31 23:54:24 If this ends up null for some reason, then the tes
+ EXPECT_EQ(1u, helper.cssRules()->length());
+ EXPECT_EQ(String(cssRule), helper.cssRules()->item(0)->cssText());
+ EXPECT_EQ(CSSRule::PAGE_RULE, helper.cssRules()->item(0)->type());
+ if (CSSPageRule* pageRule = toCSSPageRule(helper.cssRules()->item(0)))
+ EXPECT_EQ(":left", pageRule->selectorText());
+ }
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSPageRule.cpp ('k') | third_party/WebKit/Source/core/css/CSSRule.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698