| 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 <memory> | 7 #include <memory> |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
| 10 #include "core/dom/Range.h" | 10 #include "core/dom/Range.h" |
| (...skipping 1946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1957 EXPECT_EQ(0u, GetDocument().Markers().Markers()[0]->StartOffset()); | 1957 EXPECT_EQ(0u, GetDocument().Markers().Markers()[0]->StartOffset()); |
| 1958 EXPECT_EQ(5u, GetDocument().Markers().Markers()[0]->EndOffset()); | 1958 EXPECT_EQ(5u, GetDocument().Markers().Markers()[0]->EndOffset()); |
| 1959 | 1959 |
| 1960 EXPECT_EQ(10u, GetDocument().Markers().Markers()[1]->StartOffset()); | 1960 EXPECT_EQ(10u, GetDocument().Markers().Markers()[1]->StartOffset()); |
| 1961 EXPECT_EQ(20u, GetDocument().Markers().Markers()[1]->EndOffset()); | 1961 EXPECT_EQ(20u, GetDocument().Markers().Markers()[1]->EndOffset()); |
| 1962 | 1962 |
| 1963 EXPECT_EQ(20u, GetDocument().Markers().Markers()[2]->StartOffset()); | 1963 EXPECT_EQ(20u, GetDocument().Markers().Markers()[2]->StartOffset()); |
| 1964 EXPECT_EQ(25u, GetDocument().Markers().Markers()[2]->EndOffset()); | 1964 EXPECT_EQ(25u, GetDocument().Markers().Markers()[2]->EndOffset()); |
| 1965 } | 1965 } |
| 1966 | 1966 |
| 1967 // For http://crbug.com/712761 |
| 1968 TEST_F(InputMethodControllerTest, TextInputTypeAtBeforeEditable) { |
| 1969 GetDocument().body()->setContentEditable("true", ASSERT_NO_EXCEPTION); |
| 1970 GetDocument().body()->focus(); |
| 1971 |
| 1972 // Set selection before BODY(editable). |
| 1973 GetFrame().Selection().SetSelection( |
| 1974 SelectionInDOMTree::Builder() |
| 1975 .Collapse(Position(GetDocument().documentElement(), 0)) |
| 1976 .Build()); |
| 1977 |
| 1978 EXPECT_EQ(kWebTextInputTypeContentEditable, Controller().TextInputType()); |
| 1979 } |
| 1980 |
| 1967 } // namespace blink | 1981 } // namespace blink |
| OLD | NEW |