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 |