| 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/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/html/HTMLDocument.h" | 9 #include "core/html/HTMLDocument.h" |
| 10 #include "core/testing/DummyPageHolder.h" | 10 #include "core/testing/DummyPageHolder.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 document.view()->updateLayoutAndStyleIfNeededRecursive(); | 35 document.view()->updateLayoutAndStyleIfNeededRecursive(); |
| 36 m_textControl = toHTMLTextFormControlElement(document.getElementById("textar
ea")); | 36 m_textControl = toHTMLTextFormControlElement(document.getElementById("textar
ea")); |
| 37 m_textControl->focus(); | 37 m_textControl->focus(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 TEST_F(HTMLTextFormControlElementTest, SetSelectionRange) | 40 TEST_F(HTMLTextFormControlElementTest, SetSelectionRange) |
| 41 { | 41 { |
| 42 EXPECT_EQ(0, textControl().selectionStart()); | 42 EXPECT_EQ(0, textControl().selectionStart()); |
| 43 EXPECT_EQ(0, textControl().selectionEnd()); | 43 EXPECT_EQ(0, textControl().selectionEnd()); |
| 44 | 44 |
| 45 textControl().setInnerTextValue("Hello, text form."); | 45 textControl().setInnerEditorValue("Hello, text form."); |
| 46 EXPECT_EQ(0, textControl().selectionStart()); | 46 EXPECT_EQ(0, textControl().selectionStart()); |
| 47 EXPECT_EQ(0, textControl().selectionEnd()); | 47 EXPECT_EQ(0, textControl().selectionEnd()); |
| 48 | 48 |
| 49 textControl().setSelectionRange(1, 3); | 49 textControl().setSelectionRange(1, 3); |
| 50 EXPECT_EQ(1, textControl().selectionStart()); | 50 EXPECT_EQ(1, textControl().selectionStart()); |
| 51 EXPECT_EQ(3, textControl().selectionEnd()); | 51 EXPECT_EQ(3, textControl().selectionEnd()); |
| 52 } | 52 } |
| 53 | 53 |
| 54 } | 54 } |
| OLD | NEW |