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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_unittest.mm

Issue 12042002: Alternate NTP: Add search token to omnibox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 7 years, 10 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 | Annotate | Revision Log
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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "base/memory/scoped_nsobject.h" 8 #include "base/memory/scoped_nsobject.h"
9 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h" 9 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h"
10 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h" 10 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h"
(...skipping 12 matching lines...) Expand all
23 using ::testing::InSequence; 23 using ::testing::InSequence;
24 using ::testing::Return; 24 using ::testing::Return;
25 using ::testing::ReturnArg; 25 using ::testing::ReturnArg;
26 using ::testing::StrictMock; 26 using ::testing::StrictMock;
27 using ::testing::_; 27 using ::testing::_;
28 28
29 namespace { 29 namespace {
30 30
31 class MockDecoration : public LocationBarDecoration { 31 class MockDecoration : public LocationBarDecoration {
32 public: 32 public:
33 virtual CGFloat GetWidthForSpace(CGFloat width) { return 20.0; } 33 virtual CGFloat GetWidthForSpace(CGFloat width, CGFloat text_width) {
34 return 20.0;
35 }
34 36
35 virtual void DrawInFrame(NSRect frame, NSView* control_view) { ; } 37 virtual void DrawInFrame(NSRect frame, NSView* control_view) { ; }
36 MOCK_METHOD0(AcceptsMousePress, bool()); 38 MOCK_METHOD0(AcceptsMousePress, bool());
37 MOCK_METHOD1(OnMousePressed, bool(NSRect frame)); 39 MOCK_METHOD1(OnMousePressed, bool(NSRect frame));
38 MOCK_METHOD0(GetMenu, NSMenu*()); 40 MOCK_METHOD0(GetMenu, NSMenu*());
39 }; 41 };
40 42
41 // Mock up an incrementing event number. 43 // Mock up an incrementing event number.
42 NSUInteger eventNumber = 0; 44 NSUInteger eventNumber = 0;
43 45
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 scoped_nsobject<AutocompleteTextField> pin([field_ retain]); 812 scoped_nsobject<AutocompleteTextField> pin([field_ retain]);
811 [field_ removeFromSuperview]; 813 [field_ removeFromSuperview];
812 [test_window() resignKeyWindow]; 814 [test_window() resignKeyWindow];
813 815
814 [[test_window() contentView] addSubview:field_]; 816 [[test_window() contentView] addSubview:field_];
815 EXPECT_CALL(field_observer_, ClosePopup()); 817 EXPECT_CALL(field_observer_, ClosePopup());
816 [test_window() resignKeyWindow]; 818 [test_window() resignKeyWindow];
817 } 819 }
818 820
819 } // namespace 821 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698