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

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

Issue 2636013002: Disable browser key reservation in fullscreen mode (Closed)
Patch Set: Add test cases Created 3 years, 11 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_command_controller.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_command_controller_unittest.cc
diff --git a/chrome/browser/ui/browser_command_controller_unittest.cc b/chrome/browser/ui/browser_command_controller_unittest.cc
index 46198da7376293f7109127f445bf25f6083caa32..57b79dd60e6ee89a42a739ec83f07a5212fa9151 100644
--- a/chrome/browser/ui/browser_command_controller_unittest.cc
+++ b/chrome/browser/ui/browser_command_controller_unittest.cc
@@ -359,6 +359,30 @@ TEST_F(BrowserCommandControllerFullscreenTest,
EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_VIEW_PASSWORDS));
EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_ABOUT));
EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_SHOW_APP_MENU));
+ EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey(
dominickn 2017/01/30 01:01:19 Nit: add a newline and comment above this saying:
Hzj_jie 2017/02/08 00:24:07 Done.
+ IDC_CLOSE_TAB,
+ content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
+ EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey(
+ IDC_CLOSE_WINDOW,
+ content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
+ EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey(
+ IDC_NEW_INCOGNITO_WINDOW,
+ content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
+ EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey(
+ IDC_NEW_TAB,
+ content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
+ EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey(
+ IDC_NEW_WINDOW,
+ content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
+ EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey(
+ IDC_SELECT_NEXT_TAB,
+ content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
+ EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey(
+ IDC_SELECT_PREVIOUS_TAB,
+ content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
+ EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey(
+ IDC_EXIT,
+ content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
dominickn 2017/01/30 01:01:19 Can you EXPECT_TRUE that IDC_FULLSCREEN is reserve
Hzj_jie 2017/02/08 00:24:07 Done.
EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_FULLSCREEN));
// Exit fullscreen.
@@ -384,6 +408,30 @@ TEST_F(BrowserCommandControllerFullscreenTest,
EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_VIEW_PASSWORDS));
EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_ABOUT));
EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_SHOW_APP_MENU));
+ EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
+ IDC_CLOSE_TAB,
+ content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
+ EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
+ IDC_CLOSE_WINDOW,
+ content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
+ EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
+ IDC_NEW_INCOGNITO_WINDOW,
+ content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
+ EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
+ IDC_NEW_TAB,
+ content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
+ EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
+ IDC_NEW_WINDOW,
+ content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
+ EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
+ IDC_SELECT_NEXT_TAB,
+ content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
+ EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
+ IDC_SELECT_PREVIOUS_TAB,
+ content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
+ EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
+ IDC_EXIT,
+ content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_FULLSCREEN));
// Guest Profiles disallow some options.
« no previous file with comments | « chrome/browser/ui/browser_command_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698