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

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

Issue 2778523002: Revert change http://crrev.com/3c7af99a93f4b4837b2fbee5cb66697f66ccf241/ (Closed)
Patch Set: Resolve review comments Created 3 years, 9 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 unified diff | Download patch
« 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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_FEEDBACK)); 354 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_FEEDBACK));
355 #endif 355 #endif
356 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_OPTIONS)); 356 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_OPTIONS));
357 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_IMPORT_SETTINGS)); 357 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_IMPORT_SETTINGS));
358 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_EDIT_SEARCH_ENGINES)); 358 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_EDIT_SEARCH_ENGINES));
359 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_VIEW_PASSWORDS)); 359 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_VIEW_PASSWORDS));
360 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_ABOUT)); 360 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_ABOUT));
361 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_SHOW_APP_MENU)); 361 EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_SHOW_APP_MENU));
362 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_FULLSCREEN)); 362 EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_FULLSCREEN));
363 363
364 // In fullscreen, only the exit fullscreen commands are reserved. All other 364 EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
365 // shortcuts should be delivered to the web page. See https://goo.gl/4tJ32G.
366 EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey(
367 IDC_CLOSE_TAB, 365 IDC_CLOSE_TAB,
368 content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0))); 366 content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
369 EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey( 367 EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
370 IDC_CLOSE_WINDOW, 368 IDC_CLOSE_WINDOW,
371 content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0))); 369 content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
372 EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey( 370 EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
373 IDC_NEW_INCOGNITO_WINDOW, 371 IDC_NEW_INCOGNITO_WINDOW,
374 content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0))); 372 content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
375 EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey( 373 EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
376 IDC_NEW_TAB, 374 IDC_NEW_TAB,
377 content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0))); 375 content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
378 EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey( 376 EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
379 IDC_NEW_WINDOW, 377 IDC_NEW_WINDOW,
380 content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0))); 378 content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
381 EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey( 379 EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
382 IDC_SELECT_NEXT_TAB, 380 IDC_SELECT_NEXT_TAB,
383 content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0))); 381 content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
384 EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey( 382 EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
385 IDC_SELECT_PREVIOUS_TAB, 383 IDC_SELECT_PREVIOUS_TAB,
386 content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0))); 384 content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
387 EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey( 385 EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(
388 IDC_EXIT, 386 IDC_EXIT,
389 content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0))); 387 content::NativeWebKeyboardEvent(blink::WebInputEvent::TypeFirst, 0, 0)));
390 388
391 // Exit fullscreen. 389 // Exit fullscreen.
392 chrome::ToggleFullscreenMode(browser()); 390 chrome::ToggleFullscreenMode(browser());
393 ASSERT_FALSE(browser()->window()->IsFullscreen()); 391 ASSERT_FALSE(browser()->window()->IsFullscreen());
394 browser()->command_controller()->FullscreenStateChanged(); 392 browser()->command_controller()->FullscreenStateChanged();
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 496
499 TEST_F(BrowserCommandControllerTest, OnSigninAllowedPrefChange) { 497 TEST_F(BrowserCommandControllerTest, OnSigninAllowedPrefChange) {
500 chrome::BrowserCommandController command_controller(browser()); 498 chrome::BrowserCommandController command_controller(browser());
501 const CommandUpdater* command_updater = command_controller.command_updater(); 499 const CommandUpdater* command_updater = command_controller.command_updater();
502 500
503 // Check that the SYNC_SETUP command is updated on preference change. 501 // Check that the SYNC_SETUP command is updated on preference change.
504 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); 502 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP));
505 profile()->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false); 503 profile()->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false);
506 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); 504 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP));
507 } 505 }
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