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

Side by Side Diff: ui/app_list/cocoa/app_list_view_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, 5 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 #include "base/memory/scoped_nsobject.h" 5 #include "base/mac/scoped_nsobject.h"
6 #import "testing/gtest_mac.h" 6 #import "testing/gtest_mac.h"
7 #import "ui/app_list/cocoa/app_list_view_controller.h" 7 #import "ui/app_list/cocoa/app_list_view_controller.h"
8 #import "ui/app_list/cocoa/apps_grid_controller.h" 8 #import "ui/app_list/cocoa/apps_grid_controller.h"
9 #import "ui/app_list/cocoa/test/apps_grid_controller_test_helper.h" 9 #import "ui/app_list/cocoa/test/apps_grid_controller_test_helper.h"
10 #include "ui/app_list/test/app_list_test_model.h" 10 #include "ui/app_list/test/app_list_test_model.h"
11 #include "ui/app_list/test/app_list_test_view_delegate.h" 11 #include "ui/app_list/test/app_list_test_view_delegate.h"
12 12
13 namespace app_list { 13 namespace app_list {
14 namespace test { 14 namespace test {
15 15
(...skipping 14 matching lines...) Expand all
30 AppsGridControllerTestHelper::TearDown(); 30 AppsGridControllerTestHelper::TearDown();
31 } 31 }
32 32
33 virtual void ResetModel(scoped_ptr<AppListModel> new_model) OVERRIDE { 33 virtual void ResetModel(scoped_ptr<AppListModel> new_model) OVERRIDE {
34 scoped_ptr<AppListViewDelegate> delegate_(new AppListTestViewDelegate); 34 scoped_ptr<AppListViewDelegate> delegate_(new AppListTestViewDelegate);
35 [app_list_view_controller_ setDelegate:delegate_.Pass() 35 [app_list_view_controller_ setDelegate:delegate_.Pass()
36 withTestModel:new_model.Pass()]; 36 withTestModel:new_model.Pass()];
37 } 37 }
38 38
39 protected: 39 protected:
40 scoped_nsobject<AppListViewController> app_list_view_controller_; 40 base::scoped_nsobject<AppListViewController> app_list_view_controller_;
41 41
42 private: 42 private:
43 DISALLOW_COPY_AND_ASSIGN(AppListViewControllerTest); 43 DISALLOW_COPY_AND_ASSIGN(AppListViewControllerTest);
44 }; 44 };
45 45
46 TEST_VIEW(AppListViewControllerTest, [app_list_view_controller_ view]); 46 TEST_VIEW(AppListViewControllerTest, [app_list_view_controller_ view]);
47 47
48 // Test that adding and removing pages updates the pager. 48 // Test that adding and removing pages updates the pager.
49 TEST_F(AppListViewControllerTest, PagerSegmentCounts) { 49 TEST_F(AppListViewControllerTest, PagerSegmentCounts) {
50 NSSegmentedControl* pager = [app_list_view_controller_ pagerControl]; 50 NSSegmentedControl* pager = [app_list_view_controller_ pagerControl];
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // Replace with a single page model, and ensure we go back to the first page. 83 // Replace with a single page model, and ensure we go back to the first page.
84 ReplaceTestModel(1); 84 ReplaceTestModel(1);
85 EXPECT_EQ(0u, [apps_grid_controller_ visiblePage]); 85 EXPECT_EQ(0u, [apps_grid_controller_ visiblePage]);
86 EXPECT_EQ(0, [pager selectedSegment]); 86 EXPECT_EQ(0, [pager selectedSegment]);
87 EXPECT_EQ(1, [pager segmentCount]); 87 EXPECT_EQ(1, [pager segmentCount]);
88 EXPECT_EQ(1.0, [apps_grid_controller_ visiblePortionOfPage:0]); 88 EXPECT_EQ(1.0, [apps_grid_controller_ visiblePortionOfPage:0]);
89 } 89 }
90 90
91 } // namespace test 91 } // namespace test
92 } // namespace app_list 92 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698