| OLD | NEW |
| 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" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 ASSERT(helper.cssRules()); | 35 ASSERT(helper.cssRules()); |
| 36 EXPECT_EQ(1u, helper.cssRules()->length()); | 36 EXPECT_EQ(1u, helper.cssRules()->length()); |
| 37 | 37 |
| 38 CSSPageRule* pageRule = toCSSPageRule(helper.cssRules()->item(0)); | 38 CSSPageRule* pageRule = toCSSPageRule(helper.cssRules()->item(0)); |
| 39 EXPECT_EQ(":left", pageRule->selectorText()); | 39 EXPECT_EQ(":left", pageRule->selectorText()); |
| 40 | 40 |
| 41 // set invalid page selector. | 41 // set invalid page selector. |
| 42 pageRule->setSelectorText(":hover"); | 42 pageRule->setSelectorText(":hover"); |
| 43 EXPECT_EQ(":left", pageRule->selectorText()); | 43 EXPECT_EQ(":left", pageRule->selectorText()); |
| 44 | 44 |
| 45 // set invalid page selector. |
| 46 pageRule->setSelectorText("right { bla"); |
| 47 EXPECT_EQ(":left", pageRule->selectorText()); |
| 48 |
| 45 // set page pseudo class selector. | 49 // set page pseudo class selector. |
| 46 pageRule->setSelectorText(":right"); | 50 pageRule->setSelectorText(":right"); |
| 47 EXPECT_EQ(":right", pageRule->selectorText()); | 51 EXPECT_EQ(":right", pageRule->selectorText()); |
| 48 | 52 |
| 49 // set page type selector. | 53 // set page type selector. |
| 50 pageRule->setSelectorText("namedpage"); | 54 pageRule->setSelectorText("namedpage"); |
| 51 EXPECT_EQ("namedpage", pageRule->selectorText()); | 55 EXPECT_EQ("namedpage", pageRule->selectorText()); |
| 52 } | 56 } |
| 53 | 57 |
| 54 } // namespace blink | 58 } // namespace blink |
| OLD | NEW |