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

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

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 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
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 #include "base/mac/scoped_nsobject.h" 5 #include "base/mac/scoped_nsobject.h"
6 #include "base/macros.h" 6 #include "base/macros.h"
7 #import "testing/gtest_mac.h" 7 #import "testing/gtest_mac.h"
8 #import "ui/app_list/cocoa/app_list_view_controller.h" 8 #import "ui/app_list/cocoa/app_list_view_controller.h"
9 #import "ui/app_list/cocoa/apps_grid_controller.h" 9 #import "ui/app_list/cocoa/apps_grid_controller.h"
10 #import "ui/app_list/cocoa/test/apps_grid_controller_test_helper.h" 10 #import "ui/app_list/cocoa/test/apps_grid_controller_test_helper.h"
(...skipping 24 matching lines...) Expand all
35 void ReplaceTestModel(int item_count) { 35 void ReplaceTestModel(int item_count) {
36 [app_list_view_controller_ setDelegate:NULL]; 36 [app_list_view_controller_ setDelegate:NULL];
37 delegate_.reset(new AppListTestViewDelegate); 37 delegate_.reset(new AppListTestViewDelegate);
38 delegate_->ReplaceTestModel(item_count); 38 delegate_->ReplaceTestModel(item_count);
39 [app_list_view_controller_ setDelegate:delegate_.get()]; 39 [app_list_view_controller_ setDelegate:delegate_.get()];
40 } 40 }
41 41
42 AppListTestModel* model() { return delegate_->GetTestModel(); } 42 AppListTestModel* model() { return delegate_->GetTestModel(); }
43 43
44 protected: 44 protected:
45 scoped_ptr<AppListTestViewDelegate> delegate_; 45 std::unique_ptr<AppListTestViewDelegate> delegate_;
46 base::scoped_nsobject<AppListViewController> app_list_view_controller_; 46 base::scoped_nsobject<AppListViewController> app_list_view_controller_;
47 47
48 private: 48 private:
49 DISALLOW_COPY_AND_ASSIGN(AppListViewControllerTest); 49 DISALLOW_COPY_AND_ASSIGN(AppListViewControllerTest);
50 }; 50 };
51 51
52 TEST_VIEW(AppListViewControllerTest, [app_list_view_controller_ view]); 52 TEST_VIEW(AppListViewControllerTest, [app_list_view_controller_ view]);
53 53
54 // Test that adding and removing pages updates the pager. 54 // Test that adding and removing pages updates the pager.
55 TEST_F(AppListViewControllerTest, PagerSegmentCounts) { 55 TEST_F(AppListViewControllerTest, PagerSegmentCounts) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // Replace with a single page model, and ensure we go back to the first page. 89 // Replace with a single page model, and ensure we go back to the first page.
90 ReplaceTestModel(1); 90 ReplaceTestModel(1);
91 EXPECT_EQ(0u, [apps_grid_controller_ visiblePage]); 91 EXPECT_EQ(0u, [apps_grid_controller_ visiblePage]);
92 EXPECT_EQ(0, [pager selectedSegment]); 92 EXPECT_EQ(0, [pager selectedSegment]);
93 EXPECT_EQ(1, [pager segmentCount]); 93 EXPECT_EQ(1, [pager segmentCount]);
94 EXPECT_EQ(1.0, [apps_grid_controller_ visiblePortionOfPage:0]); 94 EXPECT_EQ(1.0, [apps_grid_controller_ visiblePortionOfPage:0]);
95 } 95 }
96 96
97 } // namespace test 97 } // namespace test
98 } // namespace app_list 98 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/cocoa/app_list_view_controller.h ('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