| OLD | NEW |
| 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.h" | 5 #include "chrome/browser/ui/browser.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_command_controller.h" |
| 8 #include "chrome/browser/ui/browser_window_state.h" | 9 #include "chrome/browser/ui/browser_window_state.h" |
| 9 #include "chrome/test/base/browser_with_test_window_test.h" | 10 #include "chrome/test/base/browser_with_test_window_test.h" |
| 10 #include "content/public/browser/native_web_keyboard_event.h" | 11 #include "content/public/browser/native_web_keyboard_event.h" |
| 11 | 12 |
| 12 // Various assertions around setting show state. | 13 // Various assertions around setting show state. |
| 13 TEST_F(BrowserWithTestWindowTest, GetSavedWindowShowState) { | 14 TEST_F(BrowserWithTestWindowTest, GetSavedWindowShowState) { |
| 14 // Default show state is SHOW_STATE_DEFAULT. | 15 // Default show state is SHOW_STATE_DEFAULT. |
| 15 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, chrome::GetSavedWindowShowState(browser())); | 16 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, chrome::GetSavedWindowShowState(browser())); |
| 16 | 17 |
| 17 // Explicitly specifying a state should stick though. | 18 // Explicitly specifying a state should stick though. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 29 } | 30 } |
| 30 | 31 |
| 31 TEST_F(BrowserWithTestWindowTest, IsReservedCommandOrKey) { | 32 TEST_F(BrowserWithTestWindowTest, IsReservedCommandOrKey) { |
| 32 #if defined(OS_CHROMEOS) | 33 #if defined(OS_CHROMEOS) |
| 33 const content::NativeWebKeyboardEvent event(ui::ET_KEY_PRESSED, | 34 const content::NativeWebKeyboardEvent event(ui::ET_KEY_PRESSED, |
| 34 false, | 35 false, |
| 35 ui::VKEY_F1, | 36 ui::VKEY_F1, |
| 36 0, | 37 0, |
| 37 base::Time::Now().ToDoubleT()); | 38 base::Time::Now().ToDoubleT()); |
| 38 // F1-4 keys are reserved on Chrome OS. | 39 // F1-4 keys are reserved on Chrome OS. |
| 39 EXPECT_TRUE(browser()->IsReservedCommandOrKey(IDC_BACK, event)); | 40 EXPECT_TRUE(browser()->command_controller()->IsReservedCommandOrKey(IDC_BACK, |
| 41 event)); |
| 40 // ..unless |command_id| is -1. crbug.com/122978 | 42 // ..unless |command_id| is -1. crbug.com/122978 |
| 41 EXPECT_FALSE(browser()->IsReservedCommandOrKey(-1, event)); | 43 EXPECT_FALSE(browser()->command_controller()->IsReservedCommandOrKey(-1, |
| 44 event)); |
| 42 #endif | 45 #endif |
| 43 } | 46 } |
| OLD | NEW |