| 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 { |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 const char16 kAcceleratorChar = '&'; | 13 const base::char16 kAcceleratorChar = '&'; |
| 14 | 14 |
| 15 TEST(TextUtilsTest, RemoveAcceleratorChar) { | 15 TEST(TextUtilsTest, RemoveAcceleratorChar) { |
| 16 struct TestData { | 16 struct TestData { |
| 17 const char* input; | 17 const char* input; |
| 18 int accelerated_char_pos; | 18 int accelerated_char_pos; |
| 19 int accelerated_char_span; | 19 int accelerated_char_span; |
| 20 const char* output; | 20 const char* output; |
| 21 } cases[] = { | 21 } cases[] = { |
| 22 { "", -1, 0, "" }, | 22 { "", -1, 0, "" }, |
| 23 { "&", -1, 0, "" }, | 23 { "&", -1, 0, "" }, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 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 |