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

Unified Diff: chrome/browser/ui/views/accelerator_table_unittest.cc

Issue 10914231: Map fullscreen button to maximize (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 8 years, 3 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 | « chrome/browser/ui/ash/chrome_shell_delegate.cc ('k') | chrome/tools/chromeactions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9eaf616e704f890f1517cbfdfb68298bf9c3f3d3 100644
--- a/chrome/browser/ui/views/accelerator_table_unittest.cc
+++ b/chrome/browser/ui/views/accelerator_table_unittest.cc
@@ -43,6 +43,16 @@ TEST(AcceleratorTableTest, CheckDuplicatedAccelerators) {
#if defined(USE_ASH)
TEST(AcceleratorTableTest, CheckDuplicatedAcceleratorsAsh) {
+ std::set<AcceleratorMapping, Cmp> allowed_duplicates;
+#if defined(OS_CHROMEOS)
+ AcceleratorMapping exception_entry;
+ // Both Chrome and Ash have a shortcut for F4
+ exception_entry.keycode = ui::VKEY_F4;
+ exception_entry.modifiers = ui::EF_NONE;
+ exception_entry.command_id = 0; // dummy
+ allowed_duplicates.insert(exception_entry);
+#endif
+
std::set<AcceleratorMapping, Cmp> acclerators;
for (size_t i = 0; i < kAcceleratorMapLength; ++i) {
const AcceleratorMapping& entry = kAcceleratorMap[i];
@@ -56,11 +66,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
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.cc ('k') | chrome/tools/chromeactions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698