OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_COLLECTION_VIEW_CONTROLLER_TEST_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_COLLECTION_VIEW_CONTROLLER_TEST_H_ |
6 #define IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_COLLECTION_VIEW_CONTROLLER_TEST_H_ | 6 #define IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_COLLECTION_VIEW_CONTROLLER_TEST_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #import "base/ios/block_types.h" | 11 #import "base/ios/block_types.h" |
12 #import "base/mac/scoped_nsobject.h" | 12 #import "base/mac/scoped_nsobject.h" |
13 #import "ios/chrome/test/block_cleanup_test.h" | 13 #import "ios/chrome/test/block_cleanup_test.h" |
14 #import "ios/third_party/material_components_ios/src/components/CollectionCells/
src/MaterialCollectionCells.h" | 14 #import "ios/third_party/material_components_ios/src/components/CollectionCells/
src/MaterialCollectionCells.h" |
15 | 15 |
16 @class CollectionViewController; | 16 @class CollectionViewController; |
17 | 17 |
18 class CollectionViewControllerTest : public BlockCleanupTest { | 18 class CollectionViewControllerTest : public BlockCleanupTest { |
19 public: | 19 public: |
20 CollectionViewControllerTest(); | 20 CollectionViewControllerTest(); |
21 ~CollectionViewControllerTest() override; | 21 ~CollectionViewControllerTest() override; |
22 | 22 |
23 protected: | 23 protected: |
24 void TearDown() override; | 24 void TearDown() override; |
25 | 25 |
26 // Derived classes allocate their controller here. | 26 // Derived classes allocate their controller here. |
27 virtual CollectionViewController* NewController() NS_RETURNS_RETAINED = 0; | 27 virtual CollectionViewController* InstantiateController() = 0; |
28 | 28 |
29 // Tests should call this function to create their controller for testing. | 29 // Tests should call this function to create their controller for testing. |
30 void CreateController(); | 30 void CreateController(); |
31 | 31 |
32 // Will call CreateController() if |controller_| is nil. | 32 // Will call CreateController() if |controller_| is nil. |
33 CollectionViewController* controller(); | 33 CollectionViewController* controller(); |
34 | 34 |
35 // Deletes the controller. | 35 // Deletes the controller. |
36 void ResetController(); | 36 void ResetController(); |
37 | 37 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 // For |section|, deletes the item at |item|. |completion_block| is called at | 120 // For |section|, deletes the item at |item|. |completion_block| is called at |
121 // the end of the call to -performBatchUpdates:completion:. | 121 // the end of the call to -performBatchUpdates:completion:. |
122 void DeleteItem(int section, int item, ProceduralBlock completion_block); | 122 void DeleteItem(int section, int item, ProceduralBlock completion_block); |
123 | 123 |
124 private: | 124 private: |
125 base::scoped_nsobject<CollectionViewController> controller_; | 125 base::scoped_nsobject<CollectionViewController> controller_; |
126 }; | 126 }; |
127 | 127 |
128 #endif // IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_COLLECTION_VIEW_CONTROLLER_TEST
_H_ | 128 #endif // IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_COLLECTION_VIEW_CONTROLLER_TEST
_H_ |
OLD | NEW |