| 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/events/MouseEvent.h" | 10 #include "core/events/MouseEvent.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 { | 36 { |
| 37 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); | 37 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); |
| 38 m_document = toHTMLDocument(&m_dummyPageHolder->document()); | 38 m_document = toHTMLDocument(&m_dummyPageHolder->document()); |
| 39 DCHECK(m_document); | 39 DCHECK(m_document); |
| 40 } | 40 } |
| 41 | 41 |
| 42 Element* InputMethodControllerTest::insertHTMLElement( | 42 Element* InputMethodControllerTest::insertHTMLElement( |
| 43 const char* elementCode, const char* elementId) | 43 const char* elementCode, const char* elementId) |
| 44 { | 44 { |
| 45 document().write(elementCode); | 45 document().write(elementCode); |
| 46 document().updateLayout(); | 46 document().updateStyleAndLayout(); |
| 47 Element* element = document().getElementById(elementId); | 47 Element* element = document().getElementById(elementId); |
| 48 element->focus(); | 48 element->focus(); |
| 49 return element; | 49 return element; |
| 50 } | 50 } |
| 51 | 51 |
| 52 TEST_F(InputMethodControllerTest, BackspaceFromEndOfInput) | 52 TEST_F(InputMethodControllerTest, BackspaceFromEndOfInput) |
| 53 { | 53 { |
| 54 HTMLInputElement* input = toHTMLInputElement( | 54 HTMLInputElement* input = toHTMLInputElement( |
| 55 insertHTMLElement("<input id='sample'>", "sample")); | 55 insertHTMLElement("<input id='sample'>", "sample")); |
| 56 | 56 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 document().setTitle(emptyString()); | 214 document().setTitle(emptyString()); |
| 215 controller().setComposition("foo", underlines, 0, 3); | 215 controller().setComposition("foo", underlines, 0, 3); |
| 216 EXPECT_STREQ("beforeinput.isComposing:true", document().title().utf8().data(
)); | 216 EXPECT_STREQ("beforeinput.isComposing:true", document().title().utf8().data(
)); |
| 217 | 217 |
| 218 document().setTitle(emptyString()); | 218 document().setTitle(emptyString()); |
| 219 controller().confirmComposition(); | 219 controller().confirmComposition(); |
| 220 EXPECT_STREQ("beforeinput.isComposing:false", document().title().utf8().data
()); | 220 EXPECT_STREQ("beforeinput.isComposing:false", document().title().utf8().data
()); |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace blink | 223 } // namespace blink |
| OLD | NEW |