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

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

Issue 2785103004: Added available bit to m_selectorIndex. (Closed)
Patch Set: Prefer unit test. Created 3 years, 9 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/RuleSet.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/RuleSetTest.cpp
diff --git a/third_party/WebKit/Source/core/css/RuleSetTest.cpp b/third_party/WebKit/Source/core/css/RuleSetTest.cpp
index de54ff6caca0eab47de60089f43bd35e106629c9..a1fdff3f848833b3c2f6f8e1285d1604afe80191 100644
--- a/third_party/WebKit/Source/core/css/RuleSetTest.cpp
+++ b/third_party/WebKit/Source/core/css/RuleSetTest.cpp
@@ -31,6 +31,7 @@
#include "core/css/CSSTestHelper.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "wtf/text/StringBuilder.h"
namespace blink {
@@ -195,4 +196,21 @@ TEST(RuleSetTest, findBestRuleSetAndAdd_HostContextAndClass) {
ASSERT_EQ(0u, rules->size());
}
+TEST(RuleSetTest, SelectorIndexLimit) {
+ StringBuilder builder;
+
+ for (unsigned i = 0; i < 16383; i++)
+ builder.append("div,");
+
+ builder.append("b,span {}");
+
+ CSSTestHelper helper;
+ helper.addCSSRules(builder.toString().ascii().data());
+ const RuleSet& ruleSet = helper.ruleSet();
+ const HeapTerminatedArray<RuleData>* rules = ruleSet.tagRules("b");
+ ASSERT_EQ(1u, rules->size());
+ EXPECT_EQ("b", rules->at(0).selector().tagQName().localName());
+ EXPECT_FALSE(ruleSet.tagRules("span"));
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleSet.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698