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

Unified Diff: chrome/browser/ui/browser_unittest.cc

Issue 10444047: Modify Browser::IsReservedCommandOrKey() to make sure it returns false when an Ash shortcut is pres… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review 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 | « chrome/browser/ui/browser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_unittest.cc
diff --git a/chrome/browser/ui/browser_unittest.cc b/chrome/browser/ui/browser_unittest.cc
index 7693ccdf43947d1d1013cd0b2ff94ef616c230f3..11708c83e60a5e89fc6390815847c956e31ec1a3 100644
--- a/chrome/browser/ui/browser_unittest.cc
+++ b/chrome/browser/ui/browser_unittest.cc
@@ -4,7 +4,9 @@
#include "chrome/browser/ui/browser.h"
+#include "chrome/app/chrome_command_ids.h"
#include "chrome/test/base/browser_with_test_window_test.h"
+#include "content/public/browser/native_web_keyboard_event.h"
// Various assertions around setting show state.
TEST_F(BrowserWithTestWindowTest, GetSavedWindowShowState) {
@@ -21,3 +23,17 @@ TEST_F(BrowserWithTestWindowTest, GetSavedWindowShowState) {
browser()->set_show_state(ui::SHOW_STATE_FULLSCREEN);
EXPECT_EQ(ui::SHOW_STATE_FULLSCREEN, browser()->GetSavedWindowShowState());
}
+
+TEST_F(BrowserWithTestWindowTest, IsReservedCommandOrKey) {
+#if defined(OS_CHROMEOS)
+ const content::NativeWebKeyboardEvent event(ui::ET_KEY_PRESSED,
+ false,
+ ui::VKEY_F1,
+ 0,
+ base::Time::Now().ToDoubleT());
+ // F1-4 keys are reserved on Chrome OS.
+ EXPECT_TRUE(browser()->IsReservedCommandOrKey(IDC_BACK, event));
+ // ..unless |command_id| is -1. crbug.com/122978
+ EXPECT_FALSE(browser()->IsReservedCommandOrKey(-1, event));
+#endif
+}
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698