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

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

Issue 2611813002: Add support for persisting CompositionUnderlines in InputMethodController (Closed)
Patch Set: Try one more time Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/CompositionUnderline.h" 5 #include "core/editing/CompositionUnderline.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace blink { 9 namespace blink {
10 namespace { 10 namespace {
11 11
12 CompositionUnderline createCompositionUnderline(unsigned startOffset, 12 CompositionUnderline createCompositionUnderline(unsigned startOffset,
13 unsigned endOffset) { 13 unsigned endOffset) {
14 return CompositionUnderline(startOffset, endOffset, Color::transparent, false, 14 return CompositionUnderline(startOffset, endOffset, Color::transparent, false,
15 Color::transparent); 15 Color::transparent, false);
16 } 16 }
17 17
18 TEST(CompositionUnderlineTest, OneChar) { 18 TEST(CompositionUnderlineTest, OneChar) {
19 CompositionUnderline underline = createCompositionUnderline(0, 1); 19 CompositionUnderline underline = createCompositionUnderline(0, 1);
20 EXPECT_EQ(0u, underline.startOffset()); 20 EXPECT_EQ(0u, underline.startOffset());
21 EXPECT_EQ(1u, underline.endOffset()); 21 EXPECT_EQ(1u, underline.endOffset());
22 } 22 }
23 23
24 TEST(CompositionUnderlineTest, MultiChar) { 24 TEST(CompositionUnderlineTest, MultiChar) {
25 CompositionUnderline underline = createCompositionUnderline(0, 5); 25 CompositionUnderline underline = createCompositionUnderline(0, 5);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 TEST(CompositionUnderlineTest, LastCharEndBeforeStartZeroEnd) { 64 TEST(CompositionUnderlineTest, LastCharEndBeforeStartZeroEnd) {
65 CompositionUnderline underline = 65 CompositionUnderline underline =
66 createCompositionUnderline(std::numeric_limits<unsigned>::max(), 0); 66 createCompositionUnderline(std::numeric_limits<unsigned>::max(), 0);
67 EXPECT_EQ(std::numeric_limits<unsigned>::max() - 1, underline.startOffset()); 67 EXPECT_EQ(std::numeric_limits<unsigned>::max() - 1, underline.startOffset());
68 EXPECT_EQ(std::numeric_limits<unsigned>::max(), underline.endOffset()); 68 EXPECT_EQ(std::numeric_limits<unsigned>::max(), underline.endOffset());
69 } 69 }
70 70
71 } // namespace 71 } // namespace
72 } // namespace blink 72 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698