Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(696)

Side by Side Diff: ash/accelerators/accelerator_table_unittest.cc

Issue 711873002: Fix some minor typos related to the word "accelerate" and its derivative. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | athena/input/accelerator_manager_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 namespace ash { 11 namespace ash {
12 12
13 namespace { 13 namespace {
14 14
15 struct Cmp { 15 struct Cmp {
16 bool operator()(const AcceleratorData& lhs, 16 bool operator()(const AcceleratorData& lhs,
17 const AcceleratorData& rhs) { 17 const AcceleratorData& rhs) {
18 if (lhs.trigger_on_press != rhs.trigger_on_press) 18 if (lhs.trigger_on_press != rhs.trigger_on_press)
19 return lhs.trigger_on_press < rhs.trigger_on_press; 19 return lhs.trigger_on_press < rhs.trigger_on_press;
20 if (lhs.keycode != rhs.keycode) 20 if (lhs.keycode != rhs.keycode)
21 return lhs.keycode < rhs.keycode; 21 return lhs.keycode < rhs.keycode;
22 return lhs.modifiers < rhs.modifiers; 22 return lhs.modifiers < rhs.modifiers;
23 // Do not check |action|. 23 // Do not check |action|.
24 } 24 }
25 }; 25 };
26 26
27 } // namespace 27 } // namespace
28 28
29 TEST(AcceleratorTableTest, CheckDuplicatedAccelerators) { 29 TEST(AcceleratorTableTest, CheckDuplicatedAccelerators) {
30 std::set<AcceleratorData, Cmp> acclerators; 30 std::set<AcceleratorData, Cmp> accelerators;
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(accelerators.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, CheckDuplicatedReservedActions) { 41 TEST(AcceleratorTableTest, CheckDuplicatedReservedActions) {
42 std::set<AcceleratorAction> actions; 42 std::set<AcceleratorAction> actions;
43 for (size_t i = 0; i < kReservedActionsLength; ++i) { 43 for (size_t i = 0; i < kReservedActionsLength; ++i) {
(...skipping 26 matching lines...) Expand all
70 TEST(AcceleratorTableTest, CheckDuplicatedNonrepeatableActions) { 70 TEST(AcceleratorTableTest, CheckDuplicatedNonrepeatableActions) {
71 std::set<AcceleratorAction> actions; 71 std::set<AcceleratorAction> actions;
72 for (size_t i = 0; i < kNonrepeatableActionsLength; ++i) { 72 for (size_t i = 0; i < kNonrepeatableActionsLength; ++i) {
73 EXPECT_TRUE(actions.insert(kNonrepeatableActions[i]).second) 73 EXPECT_TRUE(actions.insert(kNonrepeatableActions[i]).second)
74 << "Duplicated action: " << kNonrepeatableActions[i] 74 << "Duplicated action: " << kNonrepeatableActions[i]
75 << " at index: " << i; 75 << " at index: " << i;
76 } 76 }
77 } 77 }
78 78
79 } // namespace ash 79 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | athena/input/accelerator_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698