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

Side by Side Diff: ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_button_item_unittest.mm

Issue 2761753002: Cleanup ContentSuggestions cells (Closed)
Patch Set: Fix tests Created 3 years, 9 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 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/content_suggestions/content_suggestions_text_item .h" 5 #import "ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_but ton_item.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 #if !defined(__has_feature) || !__has_feature(objc_arc) 9 #if !defined(__has_feature) || !__has_feature(objc_arc)
10 #error "This file requires ARC support." 10 #error "This file requires ARC support."
11 #endif 11 #endif
12 12
13 namespace { 13 namespace {
14 14
15 // Tests that configureCell: set all the fields of the cell. 15 // Tests that configureCell: set all the fields of the cell.
16 TEST(ContentSuggestionsTextItemTest, CellIsConfigured) { 16 TEST(ContentSuggestionsButtonItemTest, CellIsConfigured) {
17 NSString* title = @"testTitle"; 17 NSString* title = @"testTitle";
18 NSString* subtitle = @"testSubtitle"; 18 NSString* subtitle = @"testSubtitle";
19 ContentSuggestionsTextItem* item = 19 ContentSuggestionsButtonItem* item =
20 [[ContentSuggestionsTextItem alloc] initWithType:0 20 [[ContentSuggestionsButtonItem alloc] initWithType:0
21 title:title 21 title:title
22 subtitle:subtitle]; 22 subtitle:subtitle];
23 ContentSuggestionsTextCell* cell = [[[item cellClass] alloc] init]; 23 ContentSuggestionsButtonCell* cell = [[[item cellClass] alloc] init];
24 EXPECT_EQ([ContentSuggestionsTextCell class], [cell class]); 24 EXPECT_EQ([ContentSuggestionsButtonCell class], [cell class]);
25 25
26 [item configureCell:cell]; 26 [item configureCell:cell];
27 EXPECT_EQ(title, [cell.titleButton titleForState:UIControlStateNormal]); 27 EXPECT_EQ(title, [cell.titleButton titleForState:UIControlStateNormal]);
28 EXPECT_EQ(subtitle, cell.detailTextLabel.text); 28 EXPECT_EQ(subtitle, cell.detailTextLabel.text);
29 } 29 }
30 30
31 } // namespace 31 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698