Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import "chrome/browser/ui/panels/panel_browser_window_cocoa.h" | 5 #import "chrome/browser/ui/panels/panel_browser_window_cocoa.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #include <Carbon/Carbon.h> |
|
Dmitry Titov
2011/08/24 23:27:46
Why this change? Don't you now rely on one of the
jennb
2011/08/24 23:29:30
kVK_Tab was not defined until I made this change.
| |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/debugger.h" | 10 #include "base/debug/debugger.h" |
| 11 #include "base/mac/scoped_nsautorelease_pool.h" | 11 #include "base/mac/scoped_nsautorelease_pool.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/app/chrome_command_ids.h" // IDC_* | 13 #include "chrome/app/chrome_command_ids.h" // IDC_* |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/browser_list.h" | 15 #include "chrome/browser/ui/browser_list.h" |
| 16 #import "chrome/browser/ui/cocoa/browser_test_helper.h" | 16 #import "chrome/browser/ui/cocoa/browser_test_helper.h" |
| 17 #import "chrome/browser/ui/cocoa/browser_window_utils.h" | |
| 17 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 18 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
| 18 #include "chrome/browser/ui/panels/panel.h" | 19 #include "chrome/browser/ui/panels/panel.h" |
| 19 #include "chrome/browser/ui/panels/panel_manager.h" | 20 #include "chrome/browser/ui/panels/panel_manager.h" |
| 20 #import "chrome/browser/ui/panels/panel_titlebar_view_cocoa.h" | 21 #import "chrome/browser/ui/panels/panel_titlebar_view_cocoa.h" |
| 21 #import "chrome/browser/ui/panels/panel_window_controller_cocoa.h" | 22 #import "chrome/browser/ui/panels/panel_window_controller_cocoa.h" |
| 22 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 23 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 23 #include "chrome/common/chrome_notification_types.h" | 24 #include "chrome/common/chrome_notification_types.h" |
| 24 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
| 25 #include "chrome/test/base/ui_test_utils.h" | 26 #include "chrome/test/base/ui_test_utils.h" |
| 26 #include "content/browser/tab_contents/test_tab_contents.h" | 27 #include "content/browser/tab_contents/test_tab_contents.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 301 EXPECT_TRUE([close_window_menu_item isEnabled]); | 302 EXPECT_TRUE([close_window_menu_item isEnabled]); |
| 302 EXPECT_TRUE([find_menu_item isEnabled]); | 303 EXPECT_TRUE([find_menu_item isEnabled]); |
| 303 EXPECT_TRUE([find_previous_menu_item isEnabled]); | 304 EXPECT_TRUE([find_previous_menu_item isEnabled]); |
| 304 EXPECT_TRUE([find_next_menu_item isEnabled]); | 305 EXPECT_TRUE([find_next_menu_item isEnabled]); |
| 305 EXPECT_FALSE([fullscreen_menu_item isEnabled]); | 306 EXPECT_FALSE([fullscreen_menu_item isEnabled]); |
| 306 EXPECT_FALSE([presentation_menu_item isEnabled]); | 307 EXPECT_FALSE([presentation_menu_item isEnabled]); |
| 307 EXPECT_FALSE([bookmarks_menu_item isEnabled]); | 308 EXPECT_FALSE([bookmarks_menu_item isEnabled]); |
| 308 | 309 |
| 309 ClosePanelAndWait(panel->browser()); | 310 ClosePanelAndWait(panel->browser()); |
| 310 } | 311 } |
| 312 | |
| 313 TEST_F(PanelBrowserWindowCocoaTest, KeyEvent) { | |
| 314 Panel* panel = CreateTestPanel("Test Panel"); | |
| 315 NSEvent* event = [NSEvent keyEventWithType:NSKeyDown | |
| 316 location:NSZeroPoint | |
| 317 modifierFlags:NSControlKeyMask | |
| 318 timestamp:0.0 | |
| 319 windowNumber:0 | |
| 320 context:nil | |
| 321 characters:@"" | |
| 322 charactersIgnoringModifiers:@"" | |
| 323 isARepeat:NO | |
| 324 keyCode:kVK_Tab]; | |
| 325 PanelBrowserWindowCocoa* native_window = | |
| 326 static_cast<PanelBrowserWindowCocoa*>(panel->native_panel()); | |
| 327 [BrowserWindowUtils handleKeyboardEvent:event | |
| 328 inWindow:[native_window->controller_ window]]; | |
| 329 ClosePanelAndWait(panel->browser()); | |
| 330 } | |
| OLD | NEW |