Chromium Code Reviews| Index: chrome/browser/ui/views/accelerator_table_unittest.cc |
| diff --git a/chrome/browser/ui/views/accelerator_table_unittest.cc b/chrome/browser/ui/views/accelerator_table_unittest.cc |
| index 00a96325000567c5f64e3a876bbe3497f74ff8dd..e8f35df19cc9ea5396f7e3591436ae78c871cf03 100644 |
| --- a/chrome/browser/ui/views/accelerator_table_unittest.cc |
| +++ b/chrome/browser/ui/views/accelerator_table_unittest.cc |
| @@ -43,6 +43,13 @@ TEST(AcceleratorTableTest, CheckDuplicatedAccelerators) { |
| #if defined(USE_ASH) |
| TEST(AcceleratorTableTest, CheckDuplicatedAcceleratorsAsh) { |
| + std::set<AcceleratorMapping, Cmp> allowed_duplicates; |
| + AcceleratorMapping exception_entry; |
| + exception_entry.keycode = ui::VKEY_F4; // F4 has Ash and Chrome shortcuts |
|
sky
2012/09/14 22:48:05
Isn't your ifdef chromeos specific?
sschmitz
2012/09/14 23:44:57
Yes. Added #if defined(OS_CHROMEOS) around excepti
|
| + exception_entry.modifiers = ui::EF_NONE; |
| + exception_entry.command_id = 0; // dummy |
| + allowed_duplicates.insert(exception_entry); |
| + |
| std::set<AcceleratorMapping, Cmp> acclerators; |
| for (size_t i = 0; i < kAcceleratorMapLength; ++i) { |
| const AcceleratorMapping& entry = kAcceleratorMap[i]; |
| @@ -56,11 +63,13 @@ TEST(AcceleratorTableTest, CheckDuplicatedAcceleratorsAsh) { |
| entry.keycode = ash_entry.keycode; |
| entry.modifiers = ash_entry.modifiers; |
| entry.command_id = 0; // dummy |
| - EXPECT_TRUE(acclerators.insert(entry).second) |
| - << "Duplicated accelerator: " << entry.keycode << ", " |
| - << (entry.modifiers & ui::EF_SHIFT_DOWN) << ", " |
| - << (entry.modifiers & ui::EF_CONTROL_DOWN) << ", " |
| - << (entry.modifiers & ui::EF_ALT_DOWN); |
| + if (allowed_duplicates.find(entry) == allowed_duplicates.end()) { |
| + EXPECT_TRUE(acclerators.insert(entry).second) |
| + << "Duplicated accelerator: " << entry.keycode << ", " |
| + << (entry.modifiers & ui::EF_SHIFT_DOWN) << ", " |
| + << (entry.modifiers & ui::EF_CONTROL_DOWN) << ", " |
| + << (entry.modifiers & ui::EF_ALT_DOWN); |
| + } |
| } |
| } |
| #endif // USE_ASH |