From ae4be91cac1bc5036689bdcc84669b3ec16a25c0 Mon Sep 17 00:00:00 2001 From: Spencer Ahrens Date: Fri, 28 Sep 2018 09:03:50 -0700 Subject: [PATCH] fix broken animation tests Summary: UIAnimationDragCoefficient is 10.0 in tests for some reason, but we need it to be 1.0 for our tests. Reviewed By: PeteTheHeat Differential Revision: D10096375 fbshipit-source-id: 9acd042a3d87a9c6a253745fe48145f0442f6567 --- Libraries/NativeAnimation/RCTAnimationUtils.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Libraries/NativeAnimation/RCTAnimationUtils.m b/Libraries/NativeAnimation/RCTAnimationUtils.m index 7ffb4690d21..bd4b2c33e24 100644 --- a/Libraries/NativeAnimation/RCTAnimationUtils.m +++ b/Libraries/NativeAnimation/RCTAnimationUtils.m @@ -102,7 +102,13 @@ float UIAnimationDragCoefficient(void); CGFloat RCTAnimationDragCoefficient() { #if TARGET_IPHONE_SIMULATOR - return (CGFloat)UIAnimationDragCoefficient(); + if (NSClassFromString(@"XCTest") != nil) { + // UIAnimationDragCoefficient is 10.0 in tests for some reason, but + // we need it to be 1.0. Fixes T34233294 + return 1.0; + } else { + return (CGFloat)UIAnimationDragCoefficient(); + } #else return 1.0; #endif