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

Unified Diff: ui/app_list/cocoa/app_list_view_controller_unittest.mm

Issue 508813002: Move ownership of the AppListViewDelegate into the AppListService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: ui/app_list/cocoa/app_list_view_controller_unittest.mm
diff --git a/ui/app_list/cocoa/app_list_view_controller_unittest.mm b/ui/app_list/cocoa/app_list_view_controller_unittest.mm
index 60f83e7473123d71acffafe195914c1d9d50e839..47d99b546050940114a1316df18ed12d94306f63 100644
--- a/ui/app_list/cocoa/app_list_view_controller_unittest.mm
+++ b/ui/app_list/cocoa/app_list_view_controller_unittest.mm
@@ -19,39 +19,29 @@ class AppListViewControllerTest : public AppsGridControllerTestHelper {
virtual void SetUp() OVERRIDE {
app_list_view_controller_.reset([[AppListViewController alloc] init]);
- scoped_ptr<AppListTestViewDelegate> delegate(new AppListTestViewDelegate);
- [app_list_view_controller_
- setDelegate:delegate.PassAs<app_list::AppListViewDelegate>()];
+ delegate_.reset(new AppListTestViewDelegate);
+ [app_list_view_controller_ setDelegate:delegate_.get()];
SetUpWithGridController([app_list_view_controller_ appsGridController]);
[[test_window() contentView] addSubview:[app_list_view_controller_ view]];
}
virtual void TearDown() OVERRIDE {
- [app_list_view_controller_
- setDelegate:scoped_ptr<app_list::AppListViewDelegate>()];
+ [app_list_view_controller_ setDelegate:NULL];
app_list_view_controller_.reset();
AppsGridControllerTestHelper::TearDown();
}
void ReplaceTestModel(int item_count) {
- [app_list_view_controller_
- setDelegate:scoped_ptr<app_list::AppListViewDelegate>()];
- scoped_ptr<AppListTestViewDelegate> delegate(new AppListTestViewDelegate);
- delegate->ReplaceTestModel(item_count);
- [app_list_view_controller_
- setDelegate:delegate.PassAs<app_list::AppListViewDelegate>()];
+ [app_list_view_controller_ setDelegate:NULL];
+ delegate_.reset(new AppListTestViewDelegate);
+ delegate_->ReplaceTestModel(item_count);
+ [app_list_view_controller_ setDelegate:delegate_.get()];
}
- AppListTestViewDelegate* delegate() {
- return static_cast<AppListTestViewDelegate*>(
- [app_list_view_controller_ delegate]);
- }
-
- AppListTestModel* model() {
- return delegate()->GetTestModel();
- }
+ AppListTestModel* model() { return delegate_->GetTestModel(); }
protected:
+ scoped_ptr<AppListTestViewDelegate> delegate_;
base::scoped_nsobject<AppListViewController> app_list_view_controller_;
private:
« no previous file with comments | « ui/app_list/cocoa/app_list_view_controller.mm ('k') | ui/app_list/cocoa/app_list_window_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698