| 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" |
| 18 #include "platform/wtf/Compiler.h" |
| 19 #include "platform/wtf/StdLibExtras.h" |
| 20 #include "platform/wtf/Vector.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 18 #include "wtf/Compiler.h" | |
| 19 #include "wtf/StdLibExtras.h" | |
| 20 #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& GetDocument() const; | 27 Document& GetDocument() 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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 EXPECT_EQ(fallback_y, FlatTreeTraversal::NextSibling(*fallback_x)); | 695 EXPECT_EQ(fallback_y, FlatTreeTraversal::NextSibling(*fallback_x)); |
| 696 EXPECT_EQ(fallback_z, FlatTreeTraversal::NextSibling(*fallback_y)); | 696 EXPECT_EQ(fallback_z, FlatTreeTraversal::NextSibling(*fallback_y)); |
| 697 EXPECT_EQ(nullptr, FlatTreeTraversal::NextSibling(*fallback_z)); | 697 EXPECT_EQ(nullptr, FlatTreeTraversal::NextSibling(*fallback_z)); |
| 698 | 698 |
| 699 EXPECT_EQ(fallback_y, FlatTreeTraversal::PreviousSibling(*fallback_z)); | 699 EXPECT_EQ(fallback_y, FlatTreeTraversal::PreviousSibling(*fallback_z)); |
| 700 EXPECT_EQ(fallback_x, FlatTreeTraversal::PreviousSibling(*fallback_y)); | 700 EXPECT_EQ(fallback_x, FlatTreeTraversal::PreviousSibling(*fallback_y)); |
| 701 EXPECT_EQ(nullptr, FlatTreeTraversal::PreviousSibling(*fallback_x)); | 701 EXPECT_EQ(nullptr, FlatTreeTraversal::PreviousSibling(*fallback_x)); |
| 702 } | 702 } |
| 703 | 703 |
| 704 } // namespace blink | 704 } // namespace blink |
| OLD | NEW |