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

Side by Side Diff: ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome_unittest.mm

Issue 2912863005: Use MDCTypography instead of MDFRobotoFontLoader directly. (Closed)
Patch Set: Update target value in unit test Created 3 years, 6 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 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 #import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrom e.h" 5 #import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrom e.h"
6 6
7 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_footer_item .h" 7 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_footer_item .h"
8 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" 8 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 TEST(MDCCollectionViewCellChrome, PreferredHeight) { 46 TEST(MDCCollectionViewCellChrome, PreferredHeight) {
47 CollectionViewFooterItem* footerItem = 47 CollectionViewFooterItem* footerItem =
48 [[CollectionViewFooterItem alloc] initWithType:0]; 48 [[CollectionViewFooterItem alloc] initWithType:0];
49 footerItem.text = @"This is a pretty lengthy sentence."; 49 footerItem.text = @"This is a pretty lengthy sentence.";
50 CGFloat (^heightForWidth)(CGFloat width) = ^(CGFloat width) { 50 CGFloat (^heightForWidth)(CGFloat width) = ^(CGFloat width) {
51 return [MDCCollectionViewCell cr_preferredHeightForWidth:width 51 return [MDCCollectionViewCell cr_preferredHeightForWidth:width
52 forItem:footerItem]; 52 forItem:footerItem];
53 }; 53 };
54 EXPECT_NEAR(heightForWidth(300), 50, 5); 54 EXPECT_NEAR(heightForWidth(300), 50, 5);
55 EXPECT_NEAR(heightForWidth(100), 110, 5); 55 EXPECT_NEAR(heightForWidth(100), 115, 5);
lpromero 2017/05/31 15:14:48 With Roboto, heightForWidth(100) returns 114.5. Wi
56 } 56 }
57 57
58 } // namespace 58 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698