Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp

Issue 2834343002: Make InputMethodController::TextInputType() to use canonicalized position (Closed)
Patch Set: 2017-04-24T15:09:42 Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/InputMethodController.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/InputMethodController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698