| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/editing/FrameSelection.h" | 6 #include "core/editing/FrameSelection.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 8 #include "bindings/core/v8/ExceptionStatePlaceholder.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/frame/FrameView.h" | 12 #include "core/frame/FrameView.h" |
| 13 #include "core/html/HTMLBodyElement.h" | 13 #include "core/html/HTMLBodyElement.h" |
| 14 #include "core/html/HTMLDocument.h" | 14 #include "core/html/HTMLDocument.h" |
| 15 #include "core/testing/DummyPageHolder.h" | 15 #include "core/testing/DummyPageHolder.h" |
| 16 #include "wtf/OwnPtr.h" | 16 #include "wtf/OwnPtr.h" |
| 17 #include "wtf/PassRefPtr.h" | 17 #include "wtf/PassRefPtr.h" |
| 18 #include "wtf/RefPtr.h" | 18 #include "wtf/RefPtr.h" |
| 19 #include "wtf/StdLibExtras.h" | 19 #include "wtf/StdLibExtras.h" |
| 20 #include "wtf/testing/WTFTestHelpers.h" | |
| 21 #include <gtest/gtest.h> | 20 #include <gtest/gtest.h> |
| 22 | 21 |
| 23 namespace blink { | 22 namespace blink { |
| 24 | 23 |
| 25 class FrameSelectionTest : public ::testing::Test { | 24 class FrameSelectionTest : public ::testing::Test { |
| 26 protected: | 25 protected: |
| 27 void SetUp() override; | 26 void SetUp() override; |
| 28 | 27 |
| 29 DummyPageHolder& dummyPageHolder() const { return *m_dummyPageHolder; } | 28 DummyPageHolder& dummyPageHolder() const { return *m_dummyPageHolder; } |
| 30 HTMLDocument& document() const; | 29 HTMLDocument& document() const; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 EXPECT_EQ_SELECTED_TEXT("Bar Baz"); | 179 EXPECT_EQ_SELECTED_TEXT("Bar Baz"); |
| 181 // "Fo<o B|ar Baz," with the Character granularity. | 180 // "Fo<o B|ar Baz," with the Character granularity. |
| 182 selection().moveRangeSelection(VisiblePosition(Position(text, 5)), VisiblePo
sition(Position(text, 2)), CharacterGranularity); | 181 selection().moveRangeSelection(VisiblePosition(Position(text, 5)), VisiblePo
sition(Position(text, 2)), CharacterGranularity); |
| 183 EXPECT_EQ_SELECTED_TEXT("o B"); | 182 EXPECT_EQ_SELECTED_TEXT("o B"); |
| 184 // "Fo<o B|ar Baz," with the Word granularity. | 183 // "Fo<o B|ar Baz," with the Word granularity. |
| 185 selection().moveRangeSelection(VisiblePosition(Position(text, 5)), VisiblePo
sition(Position(text, 2)), WordGranularity); | 184 selection().moveRangeSelection(VisiblePosition(Position(text, 5)), VisiblePo
sition(Position(text, 2)), WordGranularity); |
| 186 EXPECT_EQ_SELECTED_TEXT("Foo Bar"); | 185 EXPECT_EQ_SELECTED_TEXT("Foo Bar"); |
| 187 } | 186 } |
| 188 | 187 |
| 189 } // namespace blink | 188 } // namespace blink |
| OLD | NEW |