| 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/html/HTMLTextFormControlElement.h" | 6 #include "core/html/HTMLTextFormControlElement.h" |
| 7 | 7 |
| 8 #include "core/dom/Position.h" | 8 #include "core/dom/Position.h" |
| 9 #include "core/dom/Text.h" | 9 #include "core/dom/Text.h" |
| 10 #include "core/editing/FrameSelection.h" | 10 #include "core/editing/FrameSelection.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 void HTMLTextFormControlElementTest::SetUp() | 70 void HTMLTextFormControlElementTest::SetUp() |
| 71 { | 71 { |
| 72 Page::PageClients pageClients; | 72 Page::PageClients pageClients; |
| 73 fillWithEmptyClients(pageClients); | 73 fillWithEmptyClients(pageClients); |
| 74 m_spellCheckerClient = adoptPtr(new DummySpellCheckerClient); | 74 m_spellCheckerClient = adoptPtr(new DummySpellCheckerClient); |
| 75 pageClients.spellCheckerClient = m_spellCheckerClient.get(); | 75 pageClients.spellCheckerClient = m_spellCheckerClient.get(); |
| 76 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients)
; | 76 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients)
; |
| 77 | 77 |
| 78 m_document = toHTMLDocument(&m_dummyPageHolder->document()); | 78 m_document = toHTMLDocument(&m_dummyPageHolder->document()); |
| 79 m_document->documentElement()->setInnerHTML("<body><textarea id=textarea></t
extarea><input id=input /></body>", ASSERT_NO_EXCEPTION); | 79 m_document->documentElement()->setInnerHTML("<body><textarea id=textarea></t
extarea><input id=input /></body>", ASSERT_NO_EXCEPTION); |
| 80 m_document->view()->updateLayoutAndStyleForPainting(); | 80 m_document->view()->updateAllLifecyclePhases(); |
| 81 m_textControl = toHTMLTextFormControlElement(m_document->getElementById("tex
tarea")); | 81 m_textControl = toHTMLTextFormControlElement(m_document->getElementById("tex
tarea")); |
| 82 m_textControl->focus(); | 82 m_textControl->focus(); |
| 83 m_input = toHTMLInputElement(m_document->getElementById("input")); | 83 m_input = toHTMLInputElement(m_document->getElementById("input")); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void HTMLTextFormControlElementTest::forceLayoutFlag() | 86 void HTMLTextFormControlElementTest::forceLayoutFlag() |
| 87 { | 87 { |
| 88 FrameView& frameView = page().frameView(); | 88 FrameView& frameView = page().frameView(); |
| 89 IntRect frameRect = frameView.frameRect(); | 89 IntRect frameRect = frameView.frameRect(); |
| 90 frameRect.setWidth(frameRect.width() + 1); | 90 frameRect.setWidth(frameRect.width() + 1); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 ASSERT_EQ(3, input->selectionStart()); | 217 ASSERT_EQ(3, input->selectionStart()); |
| 218 | 218 |
| 219 OwnPtrWillBePersistent<SpellChecker> spellChecker(SpellChecker::create(page(
).frame())); | 219 OwnPtrWillBePersistent<SpellChecker> spellChecker(SpellChecker::create(page(
).frame())); |
| 220 forceLayoutFlag(); | 220 forceLayoutFlag(); |
| 221 int startCount = layoutCount(); | 221 int startCount = layoutCount(); |
| 222 spellChecker->respondToChangedSelection(oldSelection, FrameSelection::CloseT
yping | FrameSelection::ClearTypingStyle); | 222 spellChecker->respondToChangedSelection(oldSelection, FrameSelection::CloseT
yping | FrameSelection::ClearTypingStyle); |
| 223 EXPECT_EQ(startCount, layoutCount()); | 223 EXPECT_EQ(startCount, layoutCount()); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace blink | 226 } // namespace blink |
| OLD | NEW |