Chromium Code Reviews| Index: ios/chrome/browser/ui/util/manual_text_framer_unittest.mm |
| diff --git a/ios/chrome/browser/ui/util/manual_text_framer_unittest.mm b/ios/chrome/browser/ui/util/manual_text_framer_unittest.mm |
| index 2b4e0e27d06e969da7f4b5d8aa92d76935974789..778527c3d5745d6aae1cba4496646397b8e88e6e 100644 |
| --- a/ios/chrome/browser/ui/util/manual_text_framer_unittest.mm |
| +++ b/ios/chrome/browser/ui/util/manual_text_framer_unittest.mm |
| @@ -4,6 +4,7 @@ |
| #include "ios/chrome/browser/ui/util/manual_text_framer.h" |
| +#include "base/ios/ios_util.h" |
| #include "base/mac/foundation_util.h" |
| #include "base/time/time.h" |
| #import "ios/chrome/browser/ui/util/core_text_util.h" |
| @@ -198,7 +199,11 @@ TEST_F(ManualTextFramerTest, OriginRTLTest) { |
| attributes()[NSParagraphStyleAttributeName] = CreateParagraphStyle( |
| 20.0, NSTextAlignmentNatural, NSLineBreakByWordWrapping); |
| ApplyAttributesForRange(text_range()); |
| - CGRect bounds = CGRectMake(0, 0, 100.0, 60.0); |
| + // The bounds width is chosen so that the RTL string above is laid out into 3 |
| + // lines. The font that iOS 11 uses for Arabic strings takes more horizontal |
| + // space, so the bounds width is increased accordingly. |
| + CGFloat width = base::ios::IsRunningOnIOS11OrLater() ? 130.0 : 100.0; |
|
rohitrao (ping after 24h)
2017/06/14 11:58:03
This test is very dependent on the exact sizes of
lpromero
2017/06/15 08:26:51
Dividing by 3 is not sufficient, I need to come up
|
| + CGRect bounds = CGRectMake(0, 0, width, 60.0); |
| FrameTextInBounds(bounds); |
| CheckForLineCountAndFramedRange(3, text_range()); |
| for (FramedLine* line in text_frame().lines) { |