| 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/html/TextControlElement.h" | 5 #include "core/html/TextControlElement.h" |
| 6 | 6 |
| 7 #include <memory> |
| 7 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 8 #include "core/editing/spellcheck/SpellChecker.h" | 9 #include "core/editing/spellcheck/SpellChecker.h" |
| 9 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| 10 #include "core/html/HTMLInputElement.h" | 11 #include "core/html/HTMLInputElement.h" |
| 11 #include "core/html/HTMLTextAreaElement.h" | 12 #include "core/html/HTMLTextAreaElement.h" |
| 12 #include "core/loader/EmptyClients.h" | 13 #include "core/loader/EmptyClients.h" |
| 13 #include "core/page/SpellCheckerClient.h" | 14 #include "core/page/SpellCheckerClient.h" |
| 14 #include "core/testing/DummyPageHolder.h" | 15 #include "core/testing/DummyPageHolder.h" |
| 15 #include "platform/testing/UnitTestHelpers.h" | 16 #include "platform/testing/UnitTestHelpers.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "wtf/PtrUtil.h" | 18 #include "wtf/PtrUtil.h" |
| 18 #include <memory> | |
| 19 | 19 |
| 20 namespace blink { | 20 namespace blink { |
| 21 | 21 |
| 22 class TextControlElementTest : public ::testing::Test { | 22 class TextControlElementTest : public ::testing::Test { |
| 23 protected: | 23 protected: |
| 24 void SetUp() override; | 24 void SetUp() override; |
| 25 | 25 |
| 26 DummyPageHolder& page() const { return *m_dummyPageHolder; } | 26 DummyPageHolder& page() const { return *m_dummyPageHolder; } |
| 27 Document& document() const { return *m_document; } | 27 Document& document() const { return *m_document; } |
| 28 TextControlElement& textControl() const { return *m_textControl; } | 28 TextControlElement& textControl() const { return *m_textControl; } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 HTMLInputElement* input = | 118 HTMLInputElement* input = |
| 119 toHTMLInputElement(document().getElementById("input")); | 119 toHTMLInputElement(document().getElementById("input")); |
| 120 input->setValue("Hello"); | 120 input->setValue("Hello"); |
| 121 HTMLElement* innerEditor = input->innerEditorElement(); | 121 HTMLElement* innerEditor = input->innerEditorElement(); |
| 122 EXPECT_EQ(5u, TextControlElement::indexForPosition( | 122 EXPECT_EQ(5u, TextControlElement::indexForPosition( |
| 123 innerEditor, | 123 innerEditor, |
| 124 Position(innerEditor, PositionAnchorType::AfterAnchor))); | 124 Position(innerEditor, PositionAnchorType::AfterAnchor))); |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace blink | 127 } // namespace blink |
| OLD | NEW |