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 "ash/accelerators/accelerator_table.h" | 8 #include "ash/accelerators/accelerator_table.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 for (size_t i = 0; i < kAcceleratorDataLength; ++i) { | 31 for (size_t i = 0; i < kAcceleratorDataLength; ++i) { |
32 const AcceleratorData& entry = kAcceleratorData[i]; | 32 const AcceleratorData& entry = kAcceleratorData[i]; |
33 EXPECT_TRUE(acclerators.insert(entry).second) | 33 EXPECT_TRUE(acclerators.insert(entry).second) |
34 << "Duplicated accelerator: " << entry.trigger_on_press << ", " | 34 << "Duplicated accelerator: " << entry.trigger_on_press << ", " |
35 << entry.keycode << ", " << (entry.modifiers & ui::EF_SHIFT_DOWN) | 35 << entry.keycode << ", " << (entry.modifiers & ui::EF_SHIFT_DOWN) |
36 << ", " << (entry.modifiers & ui::EF_CONTROL_DOWN) << ", " | 36 << ", " << (entry.modifiers & ui::EF_CONTROL_DOWN) << ", " |
37 << (entry.modifiers & ui::EF_ALT_DOWN); | 37 << (entry.modifiers & ui::EF_ALT_DOWN); |
38 } | 38 } |
39 } | 39 } |
40 | 40 |
41 TEST(AcceleratorTableTest, CheckDuplicatedActionsAllowedAtLoginScreen) { | 41 TEST(AcceleratorTableTest, CheckDuplicatedActionsAllowedAtLoginOrLockScreen) { |
42 std::set<AcceleratorAction> actions; | 42 std::set<AcceleratorAction> actions; |
43 for (size_t i = 0; i < kActionsAllowedAtLoginScreenLength; ++i) { | 43 for (size_t i = 0; i < kActionsAllowedAtLoginOrLockScreenLength; ++i) { |
44 EXPECT_TRUE(actions.insert(kActionsAllowedAtLoginScreen[i]).second) | 44 EXPECT_TRUE(actions.insert(kActionsAllowedAtLoginOrLockScreen[i]).second) |
45 << "Duplicated action: " << kActionsAllowedAtLoginScreen[i]; | 45 << "Duplicated action: " << kActionsAllowedAtLoginOrLockScreen[i]; |
| 46 } |
| 47 for (size_t i = 0; i < kActionsAllowedAtLockScreenLength; ++i) { |
| 48 EXPECT_TRUE(actions.insert(kActionsAllowedAtLockScreen[i]).second) |
| 49 << "Duplicated action: " << kActionsAllowedAtLockScreen[i]; |
46 } | 50 } |
47 } | 51 } |
48 | 52 |
49 } // namespace ash | 53 } // namespace ash |
OLD | NEW |