| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/linux_util.h" | 5 #include "ui/base/gtk/menu_label_accelerator_util.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace gfx { | 10 namespace ui { |
| 11 | 11 |
| 12 TEST(LinuxUtilTest, ConvertAcceleratorsFromWindowsStyle) { | 12 TEST(LinuxUtilTest, ConvertAcceleratorsFromWindowsStyle) { |
| 13 static const struct { | 13 static const struct { |
| 14 const char* input; | 14 const char* input; |
| 15 const char* output; | 15 const char* output; |
| 16 } cases[] = { | 16 } cases[] = { |
| 17 { "", "" }, | 17 { "", "" }, |
| 18 { "nothing", "nothing" }, | 18 { "nothing", "nothing" }, |
| 19 { "foo &bar", "foo _bar" }, | 19 { "foo &bar", "foo _bar" }, |
| 20 { "foo &&bar", "foo &bar" }, | 20 { "foo &&bar", "foo &bar" }, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 { "foo_&_bar", "foo_&&_bar" }, | 65 { "foo_&_bar", "foo_&&_bar" }, |
| 66 { "&_foo_bar_&", "&&_foo_bar_&&" }, | 66 { "&_foo_bar_&", "&&_foo_bar_&&" }, |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { | 69 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { |
| 70 std::string result = EscapeWindowsStyleAccelerators(cases[i].input); | 70 std::string result = EscapeWindowsStyleAccelerators(cases[i].input); |
| 71 EXPECT_EQ(cases[i].output, result); | 71 EXPECT_EQ(cases[i].output, result); |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 | 74 |
| 75 } // namespace gfx | 75 } // namespace ui |
| OLD | NEW |