Skip to content

Commit

Permalink
Fix animations in OSS debug builds by modifying `Platform.isTesting()…
Browse files Browse the repository at this point in the history
…` behaviour

Summary:
In D14244606 I "fixed" `Platform.isTesting()` in JS. By fixed, I made it return true when running SSTs.

People in OSS complained about this in discord and [github](#27010). The problem is that this call returns true whenever an RN project references Detox in the build.gradle file. In practice, this has been really annoying, because it has disabled animations in debug builds, due to D13811035.

The fix is to be more specific, and look for the exact screenshot test activity. I haven't explicitly verified this doesn't trigger from Detox, but it shouldn't. I'll coordinate on the github issue to verify.

Changelog: [Android][Fixed] Fix animations in OSS debug builds by modifying `Platform.isTesting()` behaviour

Reviewed By: TheSavior

Differential Revision: D19384098

fbshipit-source-id: 22c885219f2c00f5dcc3b930b068bfd2ad7e4b8e
  • Loading branch information
Peter Argany authored and facebook-github-bot committed Jan 14, 2020
1 parent cfbd93c commit 1fbc6a7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void invalidate() {}

private Boolean isRunningScreenshotTest() {
try {
Class.forName("android.support.test.rule.ActivityTestRule");
Class.forName("com.facebook.testing.react.screenshots.ReactAppScreenshotTestActivity");
return true;
} catch (ClassNotFoundException ignored) {
return false;
Expand Down

0 comments on commit 1fbc6a7

Please sign in to comment.