| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/FrameSelection.h" | 5 #include "core/editing/FrameSelection.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
| 10 #include "core/dom/Text.h" | 10 #include "core/dom/Text.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 EXPECT_EQ(Position::beforeNode(bottom->parentNode()), visibleSelectionInDOMT
ree().extent()); | 207 EXPECT_EQ(Position::beforeNode(bottom->parentNode()), visibleSelectionInDOMT
ree().extent()); |
| 208 EXPECT_EQ(Position(bottom, 0), visibleSelectionInDOMTree().start()); | 208 EXPECT_EQ(Position(bottom, 0), visibleSelectionInDOMTree().start()); |
| 209 EXPECT_EQ(Position(bottom, 3), visibleSelectionInDOMTree().end()); | 209 EXPECT_EQ(Position(bottom, 3), visibleSelectionInDOMTree().end()); |
| 210 | 210 |
| 211 EXPECT_EQ(PositionInComposedTree(bottom, 3), visibleSelectionInComposedTree(
).base()); | 211 EXPECT_EQ(PositionInComposedTree(bottom, 3), visibleSelectionInComposedTree(
).base()); |
| 212 EXPECT_EQ(PositionInComposedTree(top, 1), visibleSelectionInComposedTree().e
xtent()); | 212 EXPECT_EQ(PositionInComposedTree(top, 1), visibleSelectionInComposedTree().e
xtent()); |
| 213 EXPECT_EQ(PositionInComposedTree(top, 1), visibleSelectionInComposedTree().s
tart()); | 213 EXPECT_EQ(PositionInComposedTree(top, 1), visibleSelectionInComposedTree().s
tart()); |
| 214 EXPECT_EQ(PositionInComposedTree(bottom, 3), visibleSelectionInComposedTree(
).end()); | 214 EXPECT_EQ(PositionInComposedTree(bottom, 3), visibleSelectionInComposedTree(
).end()); |
| 215 } | 215 } |
| 216 | 216 |
| 217 TEST_F(FrameSelectionTest, SelectAllWithUnselectableRoot) |
| 218 { |
| 219 RefPtrWillBeRawPtr<Element> select = document().createElement("select", ASSE
RT_NO_EXCEPTION); |
| 220 document().replaceChild(select.get(), document().documentElement()); |
| 221 selection().selectAll(); |
| 222 EXPECT_TRUE(selection().isNone()) << "Nothing should be selected if the cont
ent of the documentElement is not selctable."; |
| 223 } |
| 224 |
| 217 } // namespace blink | 225 } // namespace blink |
| OLD | NEW |