| 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 "bindings/core/v8/ExceptionStatePlaceholder.h" | 5 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 6 #include "core/dom/Document.h" | 6 #include "core/dom/Document.h" |
| 7 #include "core/dom/Element.h" | 7 #include "core/dom/Element.h" |
| 8 #include "core/dom/Text.h" | 8 #include "core/dom/Text.h" |
| 9 #include "core/editing/FrameSelection.h" | 9 #include "core/editing/FrameSelection.h" |
| 10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 OwnPtr<DummyPageHolder> m_dummyPageHolder; | 72 OwnPtr<DummyPageHolder> m_dummyPageHolder; |
| 73 Persistent<HTMLDocument> m_document; | 73 Persistent<HTMLDocument> m_document; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 void GranularityStrategyTest::SetUp() | 76 void GranularityStrategyTest::SetUp() |
| 77 { | 77 { |
| 78 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); | 78 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); |
| 79 m_document = toHTMLDocument(&m_dummyPageHolder->document()); | 79 m_document = toHTMLDocument(&m_dummyPageHolder->document()); |
| 80 ASSERT(m_document); | 80 DCHECK(m_document); |
| 81 dummyPageHolder().frame().settings()->setDefaultFontSize(12); | 81 dummyPageHolder().frame().settings()->setDefaultFontSize(12); |
| 82 dummyPageHolder().frame().settings()->setSelectionStrategy(SelectionStrategy
::Direction); | 82 dummyPageHolder().frame().settings()->setSelectionStrategy(SelectionStrategy
::Direction); |
| 83 } | 83 } |
| 84 | 84 |
| 85 HTMLDocument& GranularityStrategyTest::document() const | 85 HTMLDocument& GranularityStrategyTest::document() const |
| 86 { | 86 { |
| 87 return *m_document; | 87 return *m_document; |
| 88 } | 88 } |
| 89 | 89 |
| 90 void GranularityStrategyTest::setSelection(const VisibleSelection& newSelection) | 90 void GranularityStrategyTest::setSelection(const VisibleSelection& newSelection) |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 | 653 |
| 654 // "ab cd efghijkl ^mnopqr |>stuvwi inm," (^ means base and | means extent, | 654 // "ab cd efghijkl ^mnopqr |>stuvwi inm," (^ means base and | means extent, |
| 655 // > means end). | 655 // > means end). |
| 656 selection().setSelection(VisibleSelection(Position(text, 15), Position(text,
22))); | 656 selection().setSelection(VisibleSelection(Position(text, 15), Position(text,
22))); |
| 657 EXPECT_EQ_SELECTED_TEXT("mnopqr "); | 657 EXPECT_EQ_SELECTED_TEXT("mnopqr "); |
| 658 selection().moveRangeSelectionExtent(m_wordMiddles[4]); | 658 selection().moveRangeSelectionExtent(m_wordMiddles[4]); |
| 659 EXPECT_EQ_SELECTED_TEXT("mnopqr iiin"); | 659 EXPECT_EQ_SELECTED_TEXT("mnopqr iiin"); |
| 660 } | 660 } |
| 661 | 661 |
| 662 } // namespace blink | 662 } // namespace blink |
| OLD | NEW |