| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/app_list/cocoa/apps_search_box_controller.h" | 5 #import "ui/app_list/cocoa/apps_search_box_controller.h" |
| 6 | 6 |
| 7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #import "testing/gtest_mac.h" | 10 #import "testing/gtest_mac.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 } | 45 } |
| 46 | 46 |
| 47 - (void)modelTextDidChange { | 47 - (void)modelTextDidChange { |
| 48 ++textChangeCount_; | 48 ++textChangeCount_; |
| 49 } | 49 } |
| 50 | 50 |
| 51 - (CGFloat)bubbleCornerRadius { | 51 - (CGFloat)bubbleCornerRadius { |
| 52 return 3; | 52 return 3; |
| 53 } | 53 } |
| 54 | 54 |
| 55 - (NSString*)currentUserName { |
| 56 return @""; |
| 57 } |
| 58 |
| 59 - (NSString*)currentUserEmail { |
| 60 return @""; |
| 61 } |
| 62 |
| 55 @end | 63 @end |
| 56 | 64 |
| 57 namespace app_list { | 65 namespace app_list { |
| 58 namespace test { | 66 namespace test { |
| 59 | 67 |
| 60 class AppsSearchBoxControllerTest : public ui::CocoaTest { | 68 class AppsSearchBoxControllerTest : public ui::CocoaTest { |
| 61 public: | 69 public: |
| 62 AppsSearchBoxControllerTest() { | 70 AppsSearchBoxControllerTest() { |
| 63 Init(); | 71 Init(); |
| 64 } | 72 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 169 |
| 162 // Test initialization and display of the custom menu item that shows the | 170 // Test initialization and display of the custom menu item that shows the |
| 163 // currently signed-in user. This is a non-interactive view. | 171 // currently signed-in user. This is a non-interactive view. |
| 164 class AppsSearchBoxCustomMenuItemTest : public ui::CocoaTest { | 172 class AppsSearchBoxCustomMenuItemTest : public ui::CocoaTest { |
| 165 public: | 173 public: |
| 166 AppsSearchBoxCustomMenuItemTest() { | 174 AppsSearchBoxCustomMenuItemTest() { |
| 167 Init(); | 175 Init(); |
| 168 } | 176 } |
| 169 | 177 |
| 170 virtual void SetUp() OVERRIDE { | 178 virtual void SetUp() OVERRIDE { |
| 171 scoped_ptr<AppListViewDelegate> delegate(new AppListTestViewDelegate); | |
| 172 current_user_menu_item_.reset([[[CurrentUserMenuItemView alloc] | 179 current_user_menu_item_.reset([[[CurrentUserMenuItemView alloc] |
| 173 initWithDelegate:delegate.get()] retain]); | 180 initWithCurrentUser:@"testUser" |
| 181 userEmail:@"testUser@chromium.org"] retain]); |
| 174 ui::CocoaTest::SetUp(); | 182 ui::CocoaTest::SetUp(); |
| 175 [[test_window() contentView] addSubview:current_user_menu_item_]; | 183 [[test_window() contentView] addSubview:current_user_menu_item_]; |
| 176 } | 184 } |
| 177 | 185 |
| 178 protected: | 186 protected: |
| 179 base::scoped_nsobject<NSView> current_user_menu_item_; | 187 base::scoped_nsobject<NSView> current_user_menu_item_; |
| 180 | 188 |
| 181 private: | 189 private: |
| 182 DISALLOW_COPY_AND_ASSIGN(AppsSearchBoxCustomMenuItemTest); | 190 DISALLOW_COPY_AND_ASSIGN(AppsSearchBoxCustomMenuItemTest); |
| 183 }; | 191 }; |
| 184 | 192 |
| 185 TEST_VIEW(AppsSearchBoxCustomMenuItemTest, current_user_menu_item_); | 193 TEST_VIEW(AppsSearchBoxCustomMenuItemTest, current_user_menu_item_); |
| 186 | 194 |
| 187 } // namespace test | 195 } // namespace test |
| 188 } // namespace app_list | 196 } // namespace app_list |
| OLD | NEW |