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 #ifndef CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_UNITTEST_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_UNITTEST_HELPER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_UNITTEST_HELPER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_UNITTEST_HELPER_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
11 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h" | 11 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h" |
12 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
13 | 13 |
14 @class AutocompleteTextFieldEditor; | 14 @class AutocompleteTextFieldEditor; |
15 | 15 |
16 // Return the right field editor for AutocompleteTextField instance. | 16 // Return the right field editor for AutocompleteTextField instance. |
17 | 17 |
18 @interface AutocompleteTextFieldWindowTestDelegate : | 18 @interface AutocompleteTextFieldWindowTestDelegate : |
19 NSObject<NSWindowDelegate> { | 19 NSObject<NSWindowDelegate> { |
20 scoped_nsobject<AutocompleteTextFieldEditor> editor_; | 20 base::scoped_nsobject<AutocompleteTextFieldEditor> editor_; |
21 } | 21 } |
22 - (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)anObject; | 22 - (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)anObject; |
23 @end | 23 @end |
24 | 24 |
25 // Allow monitoring calls into AutocompleteTextField's observer. | 25 // Allow monitoring calls into AutocompleteTextField's observer. |
26 // Being in a .h file with an anonymous namespace is strange, but this | 26 // Being in a .h file with an anonymous namespace is strange, but this |
27 // is here so the mock interface doesn't have to change in multiple | 27 // is here so the mock interface doesn't have to change in multiple |
28 // places. | 28 // places. |
29 | 29 |
30 // Any method you add here needs a unit test. You knew that. | 30 // Any method you add here needs a unit test. You knew that. |
(...skipping 19 matching lines...) Expand all Loading... |
50 MOCK_METHOD0(OnDidChange, void()); | 50 MOCK_METHOD0(OnDidChange, void()); |
51 MOCK_METHOD0(OnDidEndEditing, void()); | 51 MOCK_METHOD0(OnDidEndEditing, void()); |
52 MOCK_METHOD1(OnDoCommandBySelector, bool(SEL cmd)); | 52 MOCK_METHOD1(OnDoCommandBySelector, bool(SEL cmd)); |
53 MOCK_METHOD1(OnSetFocus, void(bool control_down)); | 53 MOCK_METHOD1(OnSetFocus, void(bool control_down)); |
54 MOCK_METHOD0(OnKillFocus, void()); | 54 MOCK_METHOD0(OnKillFocus, void()); |
55 MOCK_METHOD1(OnMouseDown, void(NSInteger button_number)); | 55 MOCK_METHOD1(OnMouseDown, void(NSInteger button_number)); |
56 MOCK_METHOD0(ShouldEnableCopyURL, bool()); | 56 MOCK_METHOD0(ShouldEnableCopyURL, bool()); |
57 }; | 57 }; |
58 | 58 |
59 #endif // CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_UNITTEST_HELPER_H_ | 59 #endif // CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_UNITTEST_HELPER_H_ |
OLD | NEW |