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/dom/Element.h" | 5 #include "core/dom/Element.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "core/dom/ClientRect.h" | 8 #include "core/dom/ClientRect.h" |
9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
10 #include "core/editing/EditingTestBase.h" | 10 #include "core/editing/EditingTestBase.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 document.View()->UpdateAllLifecyclePhases(); | 232 document.View()->UpdateAllLifecyclePhases(); |
233 EXPECT_EQ(DocumentLifecycle::kPaintClean, document.Lifecycle().GetState()); | 233 EXPECT_EQ(DocumentLifecycle::kPaintClean, document.Lifecycle().GetState()); |
234 | 234 |
235 EXPECT_FALSE(outer_sticky->StyleRef().SubtreeIsSticky()); | 235 EXPECT_FALSE(outer_sticky->StyleRef().SubtreeIsSticky()); |
236 EXPECT_FALSE(child->StyleRef().SubtreeIsSticky()); | 236 EXPECT_FALSE(child->StyleRef().SubtreeIsSticky()); |
237 EXPECT_FALSE(grandchild->StyleRef().SubtreeIsSticky()); | 237 EXPECT_FALSE(grandchild->StyleRef().SubtreeIsSticky()); |
238 EXPECT_TRUE(inner_sticky->StyleRef().SubtreeIsSticky()); | 238 EXPECT_TRUE(inner_sticky->StyleRef().SubtreeIsSticky()); |
239 EXPECT_TRUE(great_grandchild->StyleRef().SubtreeIsSticky()); | 239 EXPECT_TRUE(great_grandchild->StyleRef().SubtreeIsSticky()); |
240 } | 240 } |
241 | 241 |
| 242 TEST_F(ElementTest, GetElementsByClassNameCrash) { |
| 243 // Test for a crash in NodeListsNodeData::AddCache(). |
| 244 ASSERT_TRUE(GetDocument().InQuirksMode()); |
| 245 GetDocument().body()->getElementsByClassName("ABC DEF"); |
| 246 GetDocument().body()->getElementsByClassName("ABC DEF"); |
| 247 // The test passes if no crash happens. |
| 248 } |
| 249 |
242 } // namespace blink | 250 } // namespace blink |
OLD | NEW |