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

Unified Diff: ash/accelerators/accelerator_table_unittest.cc

Issue 10382178: Use single "modifiers" field rather than boolean fields. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/accelerators/accelerator_table.cc ('k') | chrome/browser/ui/views/accelerator_table.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_table_unittest.cc
diff --git a/ash/accelerators/accelerator_table_unittest.cc b/ash/accelerators/accelerator_table_unittest.cc
index 900adb8a2c68932c8d3e1bd89d508abc9467b9ff..9be3906f914f45ff59fb26229e8ce30a7240a2bc 100644
--- a/ash/accelerators/accelerator_table_unittest.cc
+++ b/ash/accelerators/accelerator_table_unittest.cc
@@ -19,11 +19,7 @@ struct Cmp {
return lhs.trigger_on_press < rhs.trigger_on_press;
if (lhs.keycode != rhs.keycode)
return lhs.keycode < rhs.keycode;
- if (lhs.shift != rhs.shift)
- return lhs.shift < rhs.shift;
- if (lhs.ctrl != rhs.ctrl)
- return lhs.ctrl < rhs.ctrl;
- return lhs.alt < rhs.alt;
+ return lhs.modifiers < rhs.modifiers;
// Do not check |action|.
}
};
@@ -36,8 +32,9 @@ TEST(AcceleratorTableTest, CheckDuplicatedAccelerators) {
const AcceleratorData& entry = kAcceleratorData[i];
EXPECT_TRUE(acclerators.insert(entry).second)
<< "Duplicated accelerator: " << entry.trigger_on_press << ", "
- << entry.keycode << ", " << entry.shift << ", " << entry.ctrl << ", "
- << entry.alt;
+ << entry.keycode << ", " << (entry.modifiers & ui::EF_SHIFT_DOWN)
+ << ", " << (entry.modifiers & ui::EF_CONTROL_DOWN) << ", "
+ << (entry.modifiers & ui::EF_ALT_DOWN);
}
}
« no previous file with comments | « ash/accelerators/accelerator_table.cc ('k') | chrome/browser/ui/views/accelerator_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698