| 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/editing/EditingUtilities.h" | 5 #include "core/editing/EditingUtilities.h" |
| 6 | 6 |
| 7 #include "core/dom/StaticNodeList.h" | 7 #include "core/dom/StaticNodeList.h" |
| 8 #include "core/editing/EditingTestBase.h" | 8 #include "core/editing/EditingTestBase.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 PositionInFlatTree(one, 0), *host) | 54 PositionInFlatTree(one, 0), *host) |
| 55 .DeepEquivalent()); | 55 .DeepEquivalent()); |
| 56 | 56 |
| 57 EXPECT_EQ( | 57 EXPECT_EQ( |
| 58 Position::FirstPositionInNode(host), | 58 Position::FirstPositionInNode(host), |
| 59 FirstEditablePositionAfterPositionInRoot(Position(three, 0), *host)); | 59 FirstEditablePositionAfterPositionInRoot(Position(three, 0), *host)); |
| 60 EXPECT_EQ( | 60 EXPECT_EQ( |
| 61 Position(one->firstChild(), 0), | 61 Position(one->firstChild(), 0), |
| 62 FirstEditableVisiblePositionAfterPositionInRoot(Position(three, 0), *host) | 62 FirstEditableVisiblePositionAfterPositionInRoot(Position(three, 0), *host) |
| 63 .DeepEquivalent()); | 63 .DeepEquivalent()); |
| 64 EXPECT_EQ(PositionInFlatTree::AfterNode(host), | 64 EXPECT_EQ(PositionInFlatTree::AfterNode(*host), |
| 65 FirstEditablePositionAfterPositionInRoot( | 65 FirstEditablePositionAfterPositionInRoot( |
| 66 PositionInFlatTree(three, 0), *host)); | 66 PositionInFlatTree(three, 0), *host)); |
| 67 EXPECT_EQ(PositionInFlatTree::LastPositionInNode(host), | 67 EXPECT_EQ(PositionInFlatTree::LastPositionInNode(host), |
| 68 FirstEditableVisiblePositionAfterPositionInRoot( | 68 FirstEditableVisiblePositionAfterPositionInRoot( |
| 69 PositionInFlatTree(three, 0), *host) | 69 PositionInFlatTree(three, 0), *host) |
| 70 .DeepEquivalent()); | 70 .DeepEquivalent()); |
| 71 } | 71 } |
| 72 | 72 |
| 73 TEST_F(EditingUtilitiesTest, enclosingBlock) { | 73 TEST_F(EditingUtilitiesTest, enclosingBlock) { |
| 74 const char* body_content = "<p id='host'><b id='one'>11</b></p>"; | 74 const char* body_content = "<p id='host'><b id='one'>11</b></p>"; |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 PositionMoveType::kBackwardDeletion)); | 899 PositionMoveType::kBackwardDeletion)); |
| 900 EXPECT_EQ(Position(node, 2), | 900 EXPECT_EQ(Position(node, 2), |
| 901 PreviousPositionOf(Position(node, 3), | 901 PreviousPositionOf(Position(node, 3), |
| 902 PositionMoveType::kBackwardDeletion)); | 902 PositionMoveType::kBackwardDeletion)); |
| 903 EXPECT_EQ(Position(node, 0), | 903 EXPECT_EQ(Position(node, 0), |
| 904 PreviousPositionOf(Position(node, 1), | 904 PreviousPositionOf(Position(node, 1), |
| 905 PositionMoveType::kBackwardDeletion)); | 905 PositionMoveType::kBackwardDeletion)); |
| 906 } | 906 } |
| 907 | 907 |
| 908 } // namespace blink | 908 } // namespace blink |
| OLD | NEW |