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

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

Issue 7031014: Support for better integration between OCMock and gtest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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) 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 <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/memory/scoped_nsobject.h" 7 #include "base/memory/scoped_nsobject.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" 9 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
10 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h" 10 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h"
11 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h" 11 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h"
12 #import "chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.h" 12 #import "chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.h"
13 #import "chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h" 13 #import "chrome/browser/ui/cocoa/location_bar/keyword_hint_decoration.h"
14 #import "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h" 14 #import "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h"
15 #import "chrome/browser/ui/cocoa/location_bar/location_icon_decoration.h" 15 #import "chrome/browser/ui/cocoa/location_bar/location_icon_decoration.h"
16 #import "chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.h" 16 #import "chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.h"
17 #import "chrome/browser/ui/cocoa/location_bar/star_decoration.h" 17 #import "chrome/browser/ui/cocoa/location_bar/star_decoration.h"
18 #include "grit/theme_resources.h" 18 #include "grit/theme_resources.h"
19 #include "testing/gmock/include/gmock/gmock.h" 19 #include "testing/gmock/include/gmock/gmock.h"
20 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
21 #include "testing/platform_test.h" 21 #include "testing/platform_test.h"
22 #include "third_party/ocmock/gtest_support.h"
22 #import "third_party/ocmock/OCMock/OCMock.h" 23 #import "third_party/ocmock/OCMock/OCMock.h"
23 #include "ui/base/resource/resource_bundle.h" 24 #include "ui/base/resource/resource_bundle.h"
24 25
25 using ::testing::Return; 26 using ::testing::Return;
26 using ::testing::StrictMock; 27 using ::testing::StrictMock;
27 using ::testing::_; 28 using ::testing::_;
28 29
29 namespace { 30 namespace {
30 31
31 // Width of the field so that we don't have to ask |field_| for it all 32 // Width of the field so that we don't have to ask |field_| for it all
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 const NSRect bounds = [view_ bounds]; 289 const NSRect bounds = [view_ bounds];
289 const NSRect leftDecorationRect = 290 const NSRect leftDecorationRect =
290 [cell frameForDecoration:&mock_left_decoration_ inFrame:bounds]; 291 [cell frameForDecoration:&mock_left_decoration_ inFrame:bounds];
291 292
292 // |controlView| gets the tooltip for the left decoration. 293 // |controlView| gets the tooltip for the left decoration.
293 id controlView = [OCMockObject mockForClass:[AutocompleteTextField class]]; 294 id controlView = [OCMockObject mockForClass:[AutocompleteTextField class]];
294 [[controlView expect] addToolTip:tooltip forRect:leftDecorationRect]; 295 [[controlView expect] addToolTip:tooltip forRect:leftDecorationRect];
295 296
296 [cell updateToolTipsInRect:bounds ofView:controlView]; 297 [cell updateToolTipsInRect:bounds ofView:controlView];
297 298
298 [controlView verify]; 299 EXPECT_OCMOCK_VERIFY(controlView);
299 } 300 }
300 301
301 } // namespace 302 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698