| 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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/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" | |
| 19 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 21 #include "testing/platform_test.h" | 20 #include "testing/platform_test.h" |
| 22 #import "third_party/ocmock/OCMock/OCMock.h" | 21 #import "third_party/ocmock/OCMock/OCMock.h" |
| 23 #include "third_party/ocmock/gtest_support.h" | 22 #include "third_party/ocmock/gtest_support.h" |
| 24 #include "ui/base/resource/resource_bundle.h" | |
| 25 | 23 |
| 26 using ::testing::Return; | 24 using ::testing::Return; |
| 27 using ::testing::StrictMock; | 25 using ::testing::StrictMock; |
| 28 using ::testing::_; | 26 using ::testing::_; |
| 29 | 27 |
| 30 namespace { | 28 namespace { |
| 31 | 29 |
| 32 // Width of the field so that we don't have to ask |field_| for it all | 30 // Width of the field so that we don't have to ask |field_| for it all |
| 33 // the time. | 31 // the time. |
| 34 const CGFloat kWidth(300.0); | 32 const CGFloat kWidth(300.0); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 // |controlView| gets the tooltip for the left decoration. | 287 // |controlView| gets the tooltip for the left decoration. |
| 290 id controlView = [OCMockObject mockForClass:[AutocompleteTextField class]]; | 288 id controlView = [OCMockObject mockForClass:[AutocompleteTextField class]]; |
| 291 [[controlView expect] addToolTip:tooltip forRect:leftDecorationRect]; | 289 [[controlView expect] addToolTip:tooltip forRect:leftDecorationRect]; |
| 292 | 290 |
| 293 [cell updateToolTipsInRect:bounds ofView:controlView]; | 291 [cell updateToolTipsInRect:bounds ofView:controlView]; |
| 294 | 292 |
| 295 EXPECT_OCMOCK_VERIFY(controlView); | 293 EXPECT_OCMOCK_VERIFY(controlView); |
| 296 } | 294 } |
| 297 | 295 |
| 298 } // namespace | 296 } // namespace |
| OLD | NEW |