| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #import "ios/chrome/browser/ui/suggestions/suggestions_expandable_item.h" | 5 #import "ios/chrome/browser/ui/suggestions/suggestions_expandable_item.h" |
| 6 | 6 |
| 7 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" | |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #import "third_party/ocmock/OCMock/OCMock.h" | 8 #import "third_party/ocmock/OCMock/OCMock.h" |
| 10 #include "third_party/ocmock/gtest_support.h" | 9 #include "third_party/ocmock/gtest_support.h" |
| 11 | 10 |
| 11 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 12 #error "This file requires ARC support." |
| 13 #endif |
| 14 |
| 12 // Test subclass of the SuggestionsExpandableCell. | 15 // Test subclass of the SuggestionsExpandableCell. |
| 13 @interface TestSuggestionsExpandableCell : SuggestionsExpandableCell | 16 @interface TestSuggestionsExpandableCell : SuggestionsExpandableCell |
| 14 | 17 |
| 15 @property(nonatomic) BOOL expandCalled; | 18 @property(nonatomic) BOOL expandCalled; |
| 16 @property(nonatomic) BOOL collapseCalled; | 19 @property(nonatomic) BOOL collapseCalled; |
| 17 | 20 |
| 18 @end | 21 @end |
| 19 | 22 |
| 20 @implementation TestSuggestionsExpandableCell | 23 @implementation TestSuggestionsExpandableCell |
| 21 | 24 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 [[TestSuggestionsExpandableCell alloc] init]; | 98 [[TestSuggestionsExpandableCell alloc] init]; |
| 96 item.cellClass = [TestSuggestionsExpandableCell class]; | 99 item.cellClass = [TestSuggestionsExpandableCell class]; |
| 97 | 100 |
| 98 item.expanded = NO; | 101 item.expanded = NO; |
| 99 [item configureCell:cell]; | 102 [item configureCell:cell]; |
| 100 ASSERT_TRUE(cell.collapseCalled); | 103 ASSERT_TRUE(cell.collapseCalled); |
| 101 ASSERT_FALSE(cell.expandCalled); | 104 ASSERT_FALSE(cell.expandCalled); |
| 102 } | 105 } |
| 103 | 106 |
| 104 } // namespace | 107 } // namespace |
| OLD | NEW |