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 <set> | 5 #include <set> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "chrome/browser/ui/views/accelerator_table.h" | 8 #include "chrome/browser/ui/views/accelerator_table.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "ui/events/event_constants.h" | 10 #include "ui/events/event_constants.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 accelerator_list.begin(); it != accelerator_list.end(); ++it) { | 36 accelerator_list.begin(); it != accelerator_list.end(); ++it) { |
37 const AcceleratorMapping& entry = *it; | 37 const AcceleratorMapping& entry = *it; |
38 EXPECT_TRUE(acclerators.insert(entry).second) | 38 EXPECT_TRUE(acclerators.insert(entry).second) |
39 << "Duplicated accelerator: " << entry.keycode << ", " | 39 << "Duplicated accelerator: " << entry.keycode << ", " |
40 << (entry.modifiers & ui::EF_SHIFT_DOWN) << ", " | 40 << (entry.modifiers & ui::EF_SHIFT_DOWN) << ", " |
41 << (entry.modifiers & ui::EF_CONTROL_DOWN) << ", " | 41 << (entry.modifiers & ui::EF_CONTROL_DOWN) << ", " |
42 << (entry.modifiers & ui::EF_ALT_DOWN); | 42 << (entry.modifiers & ui::EF_ALT_DOWN); |
43 } | 43 } |
44 } | 44 } |
45 | 45 |
46 #if defined(USE_ASH) && !defined(OS_WIN) | 46 #if defined(OS_CHROMEOS) |
47 TEST(AcceleratorTableTest, CheckDuplicatedAcceleratorsAsh) { | 47 TEST(AcceleratorTableTest, CheckDuplicatedAcceleratorsAsh) { |
48 std::set<AcceleratorMapping, Cmp> acclerators; | 48 std::set<AcceleratorMapping, Cmp> acclerators; |
49 const std::vector<AcceleratorMapping> accelerator_list(GetAcceleratorList()); | 49 const std::vector<AcceleratorMapping> accelerator_list(GetAcceleratorList()); |
50 for (std::vector<AcceleratorMapping>::const_iterator it = | 50 for (std::vector<AcceleratorMapping>::const_iterator it = |
51 accelerator_list.begin(); it != accelerator_list.end(); ++it) { | 51 accelerator_list.begin(); it != accelerator_list.end(); ++it) { |
52 const AcceleratorMapping& entry = *it; | 52 const AcceleratorMapping& entry = *it; |
53 acclerators.insert(entry); | 53 acclerators.insert(entry); |
54 } | 54 } |
55 for (size_t i = 0; i < ash::kAcceleratorDataLength; ++i) { | 55 for (size_t i = 0; i < ash::kAcceleratorDataLength; ++i) { |
56 const ash::AcceleratorData& ash_entry = ash::kAcceleratorData[i]; | 56 const ash::AcceleratorData& ash_entry = ash::kAcceleratorData[i]; |
(...skipping 10 matching lines...) Expand all Loading... |
67 EXPECT_TRUE(acclerators.insert(entry).second) | 67 EXPECT_TRUE(acclerators.insert(entry).second) |
68 << "Duplicated accelerator: " << entry.keycode << ", " | 68 << "Duplicated accelerator: " << entry.keycode << ", " |
69 << (entry.modifiers & ui::EF_SHIFT_DOWN) << ", " | 69 << (entry.modifiers & ui::EF_SHIFT_DOWN) << ", " |
70 << (entry.modifiers & ui::EF_CONTROL_DOWN) << ", " | 70 << (entry.modifiers & ui::EF_CONTROL_DOWN) << ", " |
71 << (entry.modifiers & ui::EF_ALT_DOWN); | 71 << (entry.modifiers & ui::EF_ALT_DOWN); |
72 } | 72 } |
73 } | 73 } |
74 #endif // USE_ASH | 74 #endif // USE_ASH |
75 | 75 |
76 } // namespace chrome | 76 } // namespace chrome |
OLD | NEW |