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 <memory> | 7 #include <memory> |
8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
10 #include "core/dom/Element.h" | 10 #include "core/dom/Element.h" |
11 #include "core/dom/Text.h" | 11 #include "core/dom/Text.h" |
12 #include "core/editing/EditingTestBase.h" | 12 #include "core/editing/EditingTestBase.h" |
13 #include "core/editing/FrameCaret.h" | 13 #include "core/editing/FrameCaret.h" |
14 #include "core/editing/SelectionController.h" | 14 #include "core/editing/SelectionController.h" |
15 #include "core/frame/FrameView.h" | 15 #include "core/frame/FrameView.h" |
16 #include "core/html/HTMLBodyElement.h" | 16 #include "core/html/HTMLBodyElement.h" |
17 #include "core/input/EventHandler.h" | 17 #include "core/input/EventHandler.h" |
18 #include "core/layout/LayoutBlock.h" | 18 #include "core/layout/LayoutBlock.h" |
19 #include "core/paint/PaintInfo.h" | 19 #include "core/paint/PaintInfo.h" |
20 #include "core/paint/PaintLayer.h" | 20 #include "core/paint/PaintLayer.h" |
21 #include "core/testing/DummyPageHolder.h" | 21 #include "core/testing/DummyPageHolder.h" |
22 #include "platform/graphics/paint/DrawingRecorder.h" | 22 #include "platform/graphics/paint/DrawingRecorder.h" |
23 #include "platform/graphics/paint/PaintController.h" | 23 #include "platform/graphics/paint/PaintController.h" |
| 24 #include "platform/wtf/PassRefPtr.h" |
| 25 #include "platform/wtf/RefPtr.h" |
| 26 #include "platform/wtf/StdLibExtras.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
25 #include "wtf/PassRefPtr.h" | |
26 #include "wtf/RefPtr.h" | |
27 #include "wtf/StdLibExtras.h" | |
28 | 28 |
29 namespace blink { | 29 namespace blink { |
30 | 30 |
31 class FrameSelectionTest : public EditingTestBase { | 31 class FrameSelectionTest : public EditingTestBase { |
32 protected: | 32 protected: |
33 const VisibleSelection& VisibleSelectionInDOMTree() const { | 33 const VisibleSelection& VisibleSelectionInDOMTree() const { |
34 return Selection().ComputeVisibleSelectionInDOMTreeDeprecated(); | 34 return Selection().ComputeVisibleSelectionInDOMTreeDeprecated(); |
35 } | 35 } |
36 const VisibleSelectionInFlatTree& GetVisibleSelectionInFlatTree() const { | 36 const VisibleSelectionInFlatTree& GetVisibleSelectionInFlatTree() const { |
37 return Selection().GetSelectionInFlatTree(); | 37 return Selection().GetSelectionInFlatTree(); |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 Selection().SetSelectedRange( | 322 Selection().SetSelectedRange( |
323 EphemeralRange(Position(text, 0), Position(text, 12)), | 323 EphemeralRange(Position(text, 0), Position(text, 12)), |
324 VP_DEFAULT_AFFINITY, SelectionDirectionalMode::kNonDirectional, 0); | 324 VP_DEFAULT_AFFINITY, SelectionDirectionalMode::kNonDirectional, 0); |
325 | 325 |
326 EXPECT_TRUE(Selection().IsHandleVisible()) | 326 EXPECT_TRUE(Selection().IsHandleVisible()) |
327 << "If handles were present before" | 327 << "If handles were present before" |
328 "selectSetSelectedRange they should be present after it."; | 328 "selectSetSelectedRange they should be present after it."; |
329 } | 329 } |
330 | 330 |
331 } // namespace blink | 331 } // namespace blink |
OLD | NEW |