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
This commit is contained in:
Spencer Ahrens 2018-09-28 09:03:50 -07:00 committed by Facebook Github Bot
parent 199c918dbe
commit ae4be91cac
1 changed files with 7 additions and 1 deletions

View File

@ -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