| 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 "ash/accelerators/accelerator_table.h" | 7 #include "ash/accelerators/accelerator_table.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 TEST(AcceleratorTableTest, CheckDuplicatedActionsAllowedAtModalWindow) { | 60 TEST(AcceleratorTableTest, CheckDuplicatedActionsAllowedAtModalWindow) { |
| 61 std::set<AcceleratorAction> actions; | 61 std::set<AcceleratorAction> actions; |
| 62 for (size_t i = 0; i < kActionsAllowedAtModalWindowLength; ++i) { | 62 for (size_t i = 0; i < kActionsAllowedAtModalWindowLength; ++i) { |
| 63 EXPECT_TRUE(actions.insert(kActionsAllowedAtModalWindow[i]).second) | 63 EXPECT_TRUE(actions.insert(kActionsAllowedAtModalWindow[i]).second) |
| 64 << "Duplicated action: " << kActionsAllowedAtModalWindow[i] | 64 << "Duplicated action: " << kActionsAllowedAtModalWindow[i] |
| 65 << " at index: " << i; | 65 << " at index: " << i; |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 | 68 |
| 69 TEST(AcceleratorTableTest, CheckDuplicatedNonrepeatableActions) { | 69 TEST(AcceleratorTableTest, CheckDuplicatedRepeatableActions) { |
| 70 std::set<AcceleratorAction> actions; | 70 std::set<AcceleratorAction> actions; |
| 71 for (size_t i = 0; i < kNonrepeatableActionsLength; ++i) { | 71 for (size_t i = 0; i < kRepeatableActionsLength; ++i) { |
| 72 EXPECT_TRUE(actions.insert(kNonrepeatableActions[i]).second) | 72 EXPECT_TRUE(actions.insert(kRepeatableActions[i]).second) |
| 73 << "Duplicated action: " << kNonrepeatableActions[i] | 73 << "Duplicated action: " << kRepeatableActions[i] << " at index: " << i; |
| 74 << " at index: " << i; | |
| 75 } | 74 } |
| 76 } | 75 } |
| 77 | 76 |
| 78 #if defined(OS_CHROMEOS) | 77 #if defined(OS_CHROMEOS) |
| 79 | 78 |
| 80 TEST(AcceleratorTableTest, CheckDeprecatedAccelerators) { | 79 TEST(AcceleratorTableTest, CheckDeprecatedAccelerators) { |
| 81 std::set<AcceleratorData, Cmp> deprecated_actions; | 80 std::set<AcceleratorData, Cmp> deprecated_actions; |
| 82 for (size_t i = 0; i < kDeprecatedAcceleratorsLength; ++i) { | 81 for (size_t i = 0; i < kDeprecatedAcceleratorsLength; ++i) { |
| 83 // A deprecated action can never appear twice in the list. | 82 // A deprecated action can never appear twice in the list. |
| 84 const AcceleratorData& entry = kDeprecatedAccelerators[i]; | 83 const AcceleratorData& entry = kDeprecatedAccelerators[i]; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 100 // The UMA histogram name must be of the format "Ash.Accelerators.*" | 99 // The UMA histogram name must be of the format "Ash.Accelerators.*" |
| 101 std::string uma_histogram(data.uma_histogram_name); | 100 std::string uma_histogram(data.uma_histogram_name); |
| 102 EXPECT_TRUE(base::StartsWith(uma_histogram, "Ash.Accelerators.", | 101 EXPECT_TRUE(base::StartsWith(uma_histogram, "Ash.Accelerators.", |
| 103 base::CompareCase::SENSITIVE)); | 102 base::CompareCase::SENSITIVE)); |
| 104 } | 103 } |
| 105 } | 104 } |
| 106 | 105 |
| 107 #endif // defined(OS_CHROMEOS) | 106 #endif // defined(OS_CHROMEOS) |
| 108 | 107 |
| 109 } // namespace ash | 108 } // namespace ash |
| OLD | NEW |