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

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

Issue 1661453002: Setting page selector text should not allow brace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/CSSParser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
(...skipping 24 matching lines...) Expand all
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/CSSParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698