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

Unified Diff: ui/app_list/cocoa/app_list_window_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
« no previous file with comments | « ui/app_list/cocoa/app_list_view_controller_unittest.mm ('k') | ui/app_list/demo/app_list_demo_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/cocoa/app_list_window_controller_unittest.mm
diff --git a/ui/app_list/cocoa/app_list_window_controller_unittest.mm b/ui/app_list/cocoa/app_list_window_controller_unittest.mm
index 9bfc06abeba244901b48d97cec580315685ac740..692f23c3a5b1219240740dabcff5e07926b1e695 100644
--- a/ui/app_list/cocoa/app_list_window_controller_unittest.mm
+++ b/ui/app_list/cocoa/app_list_window_controller_unittest.mm
@@ -24,27 +24,26 @@ class AppListWindowControllerTest : public ui::CocoaTest {
base::scoped_nsobject<AppListWindowController> controller_;
app_list::test::AppListTestViewDelegate* delegate() {
- return static_cast<app_list::test::AppListTestViewDelegate*>(
- [[controller_ appListViewController] delegate]);
+ return delegate_.get();
}
private:
+ scoped_ptr<app_list::test::AppListTestViewDelegate> delegate_;
+
DISALLOW_COPY_AND_ASSIGN(AppListWindowControllerTest);
};
-AppListWindowControllerTest::AppListWindowControllerTest() {
+AppListWindowControllerTest::AppListWindowControllerTest()
+ : delegate_(new app_list::test::AppListTestViewDelegate) {
Init();
- scoped_ptr<app_list::AppListViewDelegate> delegate(
- new app_list::test::AppListTestViewDelegate);
controller_.reset([[AppListWindowController alloc] init]);
- [[controller_ appListViewController] setDelegate:delegate.Pass()];
+ [[controller_ appListViewController] setDelegate:delegate()];
}
void AppListWindowControllerTest::TearDown() {
EXPECT_TRUE(controller_.get());
[[controller_ window] close];
- [[controller_ appListViewController]
- setDelegate:scoped_ptr<app_list::AppListViewDelegate>()];
+ [[controller_ appListViewController] setDelegate:NULL];
controller_.reset();
ui::CocoaTest::TearDown();
}
« no previous file with comments | « ui/app_list/cocoa/app_list_view_controller_unittest.mm ('k') | ui/app_list/demo/app_list_demo_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698