| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/shadow/FlatTreeTraversal.h" | 5 #include "core/dom/shadow/FlatTreeTraversal.h" |
| 6 | 6 |
| 7 #include <memory> |
| 7 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
| 8 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 9 #include "core/dom/Element.h" | 10 #include "core/dom/Element.h" |
| 10 #include "core/dom/Node.h" | 11 #include "core/dom/Node.h" |
| 11 #include "core/dom/NodeTraversal.h" | 12 #include "core/dom/NodeTraversal.h" |
| 12 #include "core/dom/shadow/ShadowRoot.h" | 13 #include "core/dom/shadow/ShadowRoot.h" |
| 13 #include "core/frame/FrameView.h" | 14 #include "core/frame/FrameView.h" |
| 14 #include "core/html/HTMLElement.h" | 15 #include "core/html/HTMLElement.h" |
| 15 #include "core/testing/DummyPageHolder.h" | 16 #include "core/testing/DummyPageHolder.h" |
| 16 #include "platform/geometry/IntSize.h" | 17 #include "platform/geometry/IntSize.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 18 #include "wtf/Compiler.h" | 19 #include "wtf/Compiler.h" |
| 19 #include "wtf/StdLibExtras.h" | 20 #include "wtf/StdLibExtras.h" |
| 20 #include "wtf/Vector.h" | 21 #include "wtf/Vector.h" |
| 21 #include <memory> | |
| 22 | 22 |
| 23 namespace blink { | 23 namespace blink { |
| 24 | 24 |
| 25 class FlatTreeTraversalTest : public ::testing::Test { | 25 class FlatTreeTraversalTest : public ::testing::Test { |
| 26 protected: | 26 protected: |
| 27 Document& document() const; | 27 Document& document() const; |
| 28 | 28 |
| 29 // Sets |mainHTML| to BODY element with |innerHTML| property and attaches | 29 // Sets |mainHTML| to BODY element with |innerHTML| property and attaches |
| 30 // shadow root to child with |shadowHTML|, then update distribution for | 30 // shadow root to child with |shadowHTML|, then update distribution for |
| 31 // calling member functions in |FlatTreeTraversal|. | 31 // calling member functions in |FlatTreeTraversal|. |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 EXPECT_EQ(slot, FlatTreeTraversal::firstChild(*parent)); | 588 EXPECT_EQ(slot, FlatTreeTraversal::firstChild(*parent)); |
| 589 EXPECT_EQ(child1, FlatTreeTraversal::firstChild(*slot)); | 589 EXPECT_EQ(child1, FlatTreeTraversal::firstChild(*slot)); |
| 590 EXPECT_EQ(child2, FlatTreeTraversal::nextSibling(*child1)); | 590 EXPECT_EQ(child2, FlatTreeTraversal::nextSibling(*child1)); |
| 591 EXPECT_EQ(nullptr, FlatTreeTraversal::nextSibling(*child2)); | 591 EXPECT_EQ(nullptr, FlatTreeTraversal::nextSibling(*child2)); |
| 592 EXPECT_EQ(slot, FlatTreeTraversal::parent(*child1)); | 592 EXPECT_EQ(slot, FlatTreeTraversal::parent(*child1)); |
| 593 EXPECT_EQ(slot, FlatTreeTraversal::parent(*child2)); | 593 EXPECT_EQ(slot, FlatTreeTraversal::parent(*child2)); |
| 594 EXPECT_EQ(parent, FlatTreeTraversal::parent(*slot)); | 594 EXPECT_EQ(parent, FlatTreeTraversal::parent(*slot)); |
| 595 } | 595 } |
| 596 | 596 |
| 597 } // namespace blink | 597 } // namespace blink |
| OLD | NEW |