| 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/editing/InputMethodController.h" | 5 #include "core/editing/InputMethodController.h" |
| 6 | 6 |
| 7 #include "core/dom/Element.h" | 7 #include "core/dom/Element.h" |
| 8 #include "core/dom/Range.h" | 8 #include "core/dom/Range.h" |
| 9 #include "core/editing/FrameSelection.h" | 9 #include "core/editing/FrameSelection.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 void SetUp() override; | 26 void SetUp() override; |
| 27 | 27 |
| 28 OwnPtr<DummyPageHolder> m_dummyPageHolder; | 28 OwnPtr<DummyPageHolder> m_dummyPageHolder; |
| 29 Persistent<HTMLDocument> m_document; | 29 Persistent<HTMLDocument> m_document; |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 void InputMethodControllerTest::SetUp() | 32 void InputMethodControllerTest::SetUp() |
| 33 { | 33 { |
| 34 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); | 34 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); |
| 35 m_document = toHTMLDocument(&m_dummyPageHolder->document()); | 35 m_document = toHTMLDocument(&m_dummyPageHolder->document()); |
| 36 ASSERT(m_document); | 36 DCHECK(m_document); |
| 37 } | 37 } |
| 38 | 38 |
| 39 Element* InputMethodControllerTest::insertHTMLElement( | 39 Element* InputMethodControllerTest::insertHTMLElement( |
| 40 const char* elementCode, const char* elementId) | 40 const char* elementCode, const char* elementId) |
| 41 { | 41 { |
| 42 document().write(elementCode); | 42 document().write(elementCode); |
| 43 document().updateLayout(); | 43 document().updateLayout(); |
| 44 Element* element = document().getElementById(elementId); | 44 Element* element = document().getElementById(elementId); |
| 45 element->focus(); | 45 element->focus(); |
| 46 return element; | 46 return element; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 Vector<CompositionUnderline> underlines; | 185 Vector<CompositionUnderline> underlines; |
| 186 underlines.append(CompositionUnderline(0, 5, Color(255, 0, 0), false, 0)); | 186 underlines.append(CompositionUnderline(0, 5, Color(255, 0, 0), false, 0)); |
| 187 controller().setComposition("foo", underlines, 0, 3); | 187 controller().setComposition("foo", underlines, 0, 3); |
| 188 controller().confirmComposition(); | 188 controller().confirmComposition(); |
| 189 | 189 |
| 190 EXPECT_STREQ("foo", input->value().utf8().data()); | 190 EXPECT_STREQ("foo", input->value().utf8().data()); |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace blink | 193 } // namespace blink |
| OLD | NEW |