Skip to content

Commit

Permalink
native Android side: only call listDartLifecycleCallbacks() during in…
Browse files Browse the repository at this point in the history
…itial run
  • Loading branch information
bartekpacia committed Oct 13, 2023
1 parent c89b10d commit 67c37b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public class PatrolJUnitRunner extends AndroidJUnitRunner {
*/
protected boolean isInitialRun;

public boolean isInitialRun() {
return isInitialRun;
}

@Override
protected boolean shouldWaitForActivitiesToComplete() {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ public static Object[] testCases() {
instrumentation.setUp(MainActivity.class);
instrumentation.waitForPatrolAppService();
Object[] dartTests = instrumentation.listDartTests();
Object[] lifecycleCallbacks = instrumentation.listLifecycleCallbacks();

if (instrumentation.isInitialRun()) {
Object[] lifecycleCallbacks = instrumentation.listLifecycleCallbacks();
}

return dartTests;
}
Expand Down

0 comments on commit 67c37b7

Please sign in to comment.