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

Unified Diff: ios/chrome/browser/ui/util/manual_text_framer_unittest.mm

Issue 2935723002: Fix ManualTextFramerTest.OriginRTLTest on iOS 11 (Closed)
Patch Set: Add comment 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 side-by-side diff with in-line comments
Download patch
« base/ios/ios_util.h ('K') | « base/ios/ios_util.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« base/ios/ios_util.h ('K') | « base/ios/ios_util.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698