| 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 | 6 |
| 7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 8 #include "core/HTMLNames.h" | 8 #include "core/HTMLNames.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" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 void testDirectionSwitchSide(); | 63 void testDirectionSwitchSide(); |
| 64 | 64 |
| 65 // Pixel coordinates of the positions for each letter within the text being
tested. | 65 // Pixel coordinates of the positions for each letter within the text being
tested. |
| 66 std::vector<IntPoint> m_letterPos; | 66 std::vector<IntPoint> m_letterPos; |
| 67 // Pixel coordinates of the middles of the words in the text being tested. | 67 // Pixel coordinates of the middles of the words in the text being tested. |
| 68 // (y coordinate is based on y coordinates of m_letterPos) | 68 // (y coordinate is based on y coordinates of m_letterPos) |
| 69 std::vector<IntPoint> m_wordMiddles; | 69 std::vector<IntPoint> m_wordMiddles; |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 OwnPtr<DummyPageHolder> m_dummyPageHolder; | 72 OwnPtr<DummyPageHolder> m_dummyPageHolder; |
| 73 RawPtr<HTMLDocument> m_document; | 73 RawPtrWillBePersistent<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 ASSERT(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 } |
| (...skipping 569 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 |