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

Side by Side Diff: chrome/browser/ui/browser_command_controller_unittest.cc

Issue 11411132: Merge 168694 - Enable fullscreen for apps windows (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1312/src/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser_command_controller.cc ('k') | no next file » | 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 "chrome/browser/ui/browser_command_controller.h" 5 #include "chrome/browser/ui/browser_command_controller.h"
6 6
7 #include "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_commands.h"
9 #include "chrome/browser/ui/browser_window_state.h" 10 #include "chrome/browser/ui/browser_window_state.h"
10 #include "chrome/test/base/browser_with_test_window_test.h" 11 #include "chrome/test/base/browser_with_test_window_test.h"
11 #include "content/public/browser/native_web_keyboard_event.h" 12 #include "content/public/browser/native_web_keyboard_event.h"
12 13
13 TEST_F(BrowserWithTestWindowTest, IsReservedCommandOrKey) { 14 TEST_F(BrowserWithTestWindowTest, IsReservedCommandOrKey) {
14 #if defined(OS_CHROMEOS) 15 #if defined(OS_CHROMEOS)
15 // F1-3 keys are reserved Chrome accelerators on Chrome OS. 16 // F1-3 keys are reserved Chrome accelerators on Chrome OS.
16 EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey( 17 EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
17 IDC_BACK, content::NativeWebKeyboardEvent(ui::ET_KEY_PRESSED, false, 18 IDC_BACK, content::NativeWebKeyboardEvent(ui::ET_KEY_PRESSED, false,
18 ui::VKEY_F1, 0, 0))); 19 ui::VKEY_F1, 0, 0)));
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 IDC_NEW_WINDOW, content::NativeWebKeyboardEvent( 110 IDC_NEW_WINDOW, content::NativeWebKeyboardEvent(
110 ui::ET_KEY_PRESSED, false, ui::VKEY_N, ui::EF_CONTROL_DOWN, 0))); 111 ui::ET_KEY_PRESSED, false, ui::VKEY_N, ui::EF_CONTROL_DOWN, 0)));
111 EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey( 112 EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey(
112 IDC_CLOSE_TAB, content::NativeWebKeyboardEvent( 113 IDC_CLOSE_TAB, content::NativeWebKeyboardEvent(
113 ui::ET_KEY_PRESSED, false, ui::VKEY_W, ui::EF_CONTROL_DOWN, 0))); 114 ui::ET_KEY_PRESSED, false, ui::VKEY_W, ui::EF_CONTROL_DOWN, 0)));
114 EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey( 115 EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey(
115 IDC_FIND, content::NativeWebKeyboardEvent( 116 IDC_FIND, content::NativeWebKeyboardEvent(
116 ui::ET_KEY_PRESSED, false, ui::VKEY_F, ui::EF_CONTROL_DOWN, 0))); 117 ui::ET_KEY_PRESSED, false, ui::VKEY_F, ui::EF_CONTROL_DOWN, 0)));
117 #endif // USE_AURA 118 #endif // USE_AURA
118 } 119 }
120
121 TEST_F(BrowserWithTestWindowTest, AppFullScreen) {
122 // Enable for tabbed browser.
123 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_FULLSCREEN));
124
125 // Enabled for app windows.
126 browser()->app_name_ = "app";
127 ASSERT_TRUE(browser()->is_app());
128 browser()->command_controller()->FullscreenStateChanged();
129 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_FULLSCREEN));
130
131 // Enabled for panels.
132 Browser::CreateParams panel_params(Browser::TYPE_PANEL, profile());
133 TestBrowserWindow panel_window;
134 panel_params.window = &panel_window;
135 Browser panel_browser(panel_params);
136 ASSERT_TRUE(panel_browser.is_type_panel());
137 EXPECT_TRUE(chrome::IsCommandEnabled(&panel_browser, IDC_FULLSCREEN));
138
139 // Disabled for app-panels.
140 panel_browser.app_name_ = "app";
141 ASSERT_TRUE(panel_browser.is_app());
142 panel_browser.command_controller()->FullscreenStateChanged();
143 EXPECT_FALSE(chrome::IsCommandEnabled(&panel_browser, IDC_FULLSCREEN));
144 }
OLDNEW
« 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