| 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 <Carbon/Carbon.h> | 5 #include <Carbon/Carbon.h> |
| 6 | 6 |
| 7 #include "base/debug/debugger.h" | 7 #include "base/debug/debugger.h" |
| 8 #include "base/memory/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 10 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" | 11 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" |
| 11 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | |
| 12 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 12 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
| 13 #import "third_party/ocmock/OCMock/OCMock.h" |
| 13 #include "third_party/ocmock/gtest_support.h" | 14 #include "third_party/ocmock/gtest_support.h" |
| 14 #import "third_party/ocmock/OCMock/OCMock.h" | |
| 15 #import "third_party/ocmock/ocmock_extensions.h" | 15 #import "third_party/ocmock/ocmock_extensions.h" |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 NSEvent* KeyEvent(const NSUInteger flags, const NSUInteger keyCode) { | 19 NSEvent* KeyEvent(const NSUInteger flags, const NSUInteger keyCode) { |
| 20 return [NSEvent keyEventWithType:NSKeyDown | 20 return [NSEvent keyEventWithType:NSKeyDown |
| 21 location:NSZeroPoint | 21 location:NSZeroPoint |
| 22 modifierFlags:flags | 22 modifierFlags:flags |
| 23 timestamp:0.0 | 23 timestamp:0.0 |
| 24 windowNumber:0 | 24 windowNumber:0 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 [window_ setDelegate:delegate]; | 96 [window_ setDelegate:delegate]; |
| 97 [window_ performKeyEquivalent:event]; | 97 [window_ performKeyEquivalent:event]; |
| 98 | 98 |
| 99 // Don't wish to mock all the way down... | 99 // Don't wish to mock all the way down... |
| 100 [window_ setDelegate:nil]; | 100 [window_ setDelegate:nil]; |
| 101 EXPECT_OCMOCK_VERIFY(delegate); | 101 EXPECT_OCMOCK_VERIFY(delegate); |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace | 104 } // namespace |
| OLD | NEW |