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 "core/dom/Document.h" | 7 #include "core/dom/Document.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/editing/Position.h" | 10 #include "core/editing/Position.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 TextCheckerClient& textChecker() override { return m_emptyTextCheckerClient; } | 56 TextCheckerClient& textChecker() override { return m_emptyTextCheckerClient; } |
57 | 57 |
58 private: | 58 private: |
59 EmptyTextCheckerClient m_emptyTextCheckerClient; | 59 EmptyTextCheckerClient m_emptyTextCheckerClient; |
60 }; | 60 }; |
61 | 61 |
62 void TextControlElementTest::SetUp() { | 62 void TextControlElementTest::SetUp() { |
63 Page::PageClients pageClients; | 63 Page::PageClients pageClients; |
64 fillWithEmptyClients(pageClients); | 64 fillWithEmptyClients(pageClients); |
65 m_spellCheckerClient = wrapUnique(new DummySpellCheckerClient); | 65 m_spellCheckerClient = WTF::wrapUnique(new DummySpellCheckerClient); |
66 pageClients.spellCheckerClient = m_spellCheckerClient.get(); | 66 pageClients.spellCheckerClient = m_spellCheckerClient.get(); |
67 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients); | 67 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients); |
68 | 68 |
69 m_document = &m_dummyPageHolder->document(); | 69 m_document = &m_dummyPageHolder->document(); |
70 m_document->documentElement()->setInnerHTML( | 70 m_document->documentElement()->setInnerHTML( |
71 "<body><textarea id=textarea></textarea><input id=input /></body>"); | 71 "<body><textarea id=textarea></textarea><input id=input /></body>"); |
72 m_document->view()->updateAllLifecyclePhases(); | 72 m_document->view()->updateAllLifecyclePhases(); |
73 m_textControl = toTextControlElement(m_document->getElementById("textarea")); | 73 m_textControl = toTextControlElement(m_document->getElementById("textarea")); |
74 m_textControl->focus(); | 74 m_textControl->focus(); |
75 m_input = toHTMLInputElement(m_document->getElementById("input")); | 75 m_input = toHTMLInputElement(m_document->getElementById("input")); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 HTMLInputElement* input = | 204 HTMLInputElement* input = |
205 toHTMLInputElement(document().getElementById("input")); | 205 toHTMLInputElement(document().getElementById("input")); |
206 input->setValue("Hello"); | 206 input->setValue("Hello"); |
207 HTMLElement* innerEditor = input->innerEditorElement(); | 207 HTMLElement* innerEditor = input->innerEditorElement(); |
208 EXPECT_EQ(5, TextControlElement::indexForPosition( | 208 EXPECT_EQ(5, TextControlElement::indexForPosition( |
209 innerEditor, | 209 innerEditor, |
210 Position(innerEditor, PositionAnchorType::AfterAnchor))); | 210 Position(innerEditor, PositionAnchorType::AfterAnchor))); |
211 } | 211 } |
212 | 212 |
213 } // namespace blink | 213 } // namespace blink |
OLD | NEW |