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

Side by Side Diff: ui/app_list/cocoa/apps_search_results_controller_unittest.mm

Issue 17593006: mac: Update clients of scoped_nsobject.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: iwyu, scoped_nsprotocol Created 7 years, 6 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 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_results_controller.h" 5 #import "ui/app_list/cocoa/apps_search_results_controller.h"
6 6
7 #include "base/memory/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #import "testing/gtest_mac.h" 11 #import "testing/gtest_mac.h"
12 #include "ui/app_list/search_result.h" 12 #include "ui/app_list/search_result.h"
13 #include "ui/app_list/test/app_list_test_model.h" 13 #include "ui/app_list/test/app_list_test_model.h"
14 #import "ui/base/test/ui_cocoa_test_helper.h" 14 #import "ui/base/test/ui_cocoa_test_helper.h"
15 #include "ui/gfx/image/image_skia_util_mac.h" 15 #include "ui/gfx/image/image_skia_util_mac.h"
16 16
17 @interface TestAppsSearchResultsDelegate : NSObject<AppsSearchResultsDelegate> { 17 @interface TestAppsSearchResultsDelegate : NSObject<AppsSearchResultsDelegate> {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 return [apps_search_results_controller_ handleCommandBySelector:c]; 75 return [apps_search_results_controller_ handleCommandBySelector:c];
76 } 76 }
77 77
78 void ExpectConsistent(); 78 void ExpectConsistent();
79 79
80 // ui::CocoaTest overrides: 80 // ui::CocoaTest overrides:
81 virtual void SetUp() OVERRIDE; 81 virtual void SetUp() OVERRIDE;
82 virtual void TearDown() OVERRIDE; 82 virtual void TearDown() OVERRIDE;
83 83
84 protected: 84 protected:
85 scoped_nsobject<TestAppsSearchResultsDelegate> delegate_; 85 base::scoped_nsobject<TestAppsSearchResultsDelegate> delegate_;
86 scoped_nsobject<AppsSearchResultsController> apps_search_results_controller_; 86 base::scoped_nsobject<AppsSearchResultsController>
87 apps_search_results_controller_;
87 88
88 private: 89 private:
89 DISALLOW_COPY_AND_ASSIGN(AppsSearchResultsControllerTest); 90 DISALLOW_COPY_AND_ASSIGN(AppsSearchResultsControllerTest);
90 }; 91 };
91 92
92 void AppsSearchResultsControllerTest::ExpectConsistent() { 93 void AppsSearchResultsControllerTest::ExpectConsistent() {
93 NSInteger item_count = [delegate_ appListModel]->results()->item_count(); 94 NSInteger item_count = [delegate_ appListModel]->results()->item_count();
94 ASSERT_EQ(item_count, 95 ASSERT_EQ(item_count,
95 [[apps_search_results_controller_ tableView] numberOfRows]); 96 [[apps_search_results_controller_ tableView] numberOfRows]);
96 97
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 // Test activating items. 220 // Test activating items.
220 EXPECT_TRUE(SimulateKeyAction(@selector(insertNewline:))); 221 EXPECT_TRUE(SimulateKeyAction(@selector(insertNewline:)));
221 EXPECT_EQ(ModelResultAt(0), [delegate_ lastOpenedResult]); 222 EXPECT_EQ(ModelResultAt(0), [delegate_ lastOpenedResult]);
222 EXPECT_TRUE(SimulateKeyAction(@selector(moveDown:))); 223 EXPECT_TRUE(SimulateKeyAction(@selector(moveDown:)));
223 EXPECT_TRUE(SimulateKeyAction(@selector(insertNewline:))); 224 EXPECT_TRUE(SimulateKeyAction(@selector(insertNewline:)));
224 EXPECT_EQ(ModelResultAt(1), [delegate_ lastOpenedResult]); 225 EXPECT_EQ(ModelResultAt(1), [delegate_ lastOpenedResult]);
225 } 226 }
226 227
227 } // namespace test 228 } // namespace test
228 } // namespace app_list 229 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698