OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/gfx/text_utils.h" | 5 #include "ui/gfx/text_utils.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace gfx { | 10 namespace gfx { |
(...skipping 30 matching lines...) Expand all Loading... |
41 { "Test\xF0\x9D\x92\x9C&ing", 6, 1, "Test\xF0\x9D\x92\x9Cing" }, | 41 { "Test\xF0\x9D\x92\x9C&ing", 6, 1, "Test\xF0\x9D\x92\x9Cing" }, |
42 { "Test&\xF0\x9D\x92\x9C&ing", 6, 1, "Test\xF0\x9D\x92\x9Cing" }, | 42 { "Test&\xF0\x9D\x92\x9C&ing", 6, 1, "Test\xF0\x9D\x92\x9Cing" }, |
43 { "Test&\xF0\x9D\x92\x9C&&ing", 4, 2, "Test\xF0\x9D\x92\x9C&ing" }, | 43 { "Test&\xF0\x9D\x92\x9C&&ing", 4, 2, "Test\xF0\x9D\x92\x9C&ing" }, |
44 { "Test&\xF0\x9D\x92\x9C&\xF0\x9D\x92\x9Cing", 6, 2, | 44 { "Test&\xF0\x9D\x92\x9C&\xF0\x9D\x92\x9Cing", 6, 2, |
45 "Test\xF0\x9D\x92\x9C\xF0\x9D\x92\x9Cing" }, | 45 "Test\xF0\x9D\x92\x9C\xF0\x9D\x92\x9Cing" }, |
46 }; | 46 }; |
47 | 47 |
48 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { | 48 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { |
49 int accelerated_char_pos; | 49 int accelerated_char_pos; |
50 int accelerated_char_span; | 50 int accelerated_char_span; |
51 string16 result = RemoveAcceleratorChar(UTF8ToUTF16(cases[i].input), | 51 base::string16 result = RemoveAcceleratorChar(UTF8ToUTF16(cases[i].input), |
52 kAcceleratorChar, | 52 kAcceleratorChar, |
53 &accelerated_char_pos, | 53 &accelerated_char_pos, |
54 &accelerated_char_span); | 54 &accelerated_char_span); |
55 EXPECT_EQ(result, UTF8ToUTF16(cases[i].output)); | 55 EXPECT_EQ(result, UTF8ToUTF16(cases[i].output)); |
56 EXPECT_EQ(accelerated_char_pos, cases[i].accelerated_char_pos); | 56 EXPECT_EQ(accelerated_char_pos, cases[i].accelerated_char_pos); |
57 EXPECT_EQ(accelerated_char_span, cases[i].accelerated_char_span); | 57 EXPECT_EQ(accelerated_char_span, cases[i].accelerated_char_span); |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 } // namespace | 61 } // namespace |
62 } // namespace gfx | 62 } // namespace gfx |
OLD | NEW |