diff --git a/app/src/main/java/org/mozilla/fenix/perf/StartupStateProvider.kt b/app/src/main/java/org/mozilla/fenix/perf/StartupStateProvider.kt index e891b6b4a..e43223bfd 100644 --- a/app/src/main/java/org/mozilla/fenix/perf/StartupStateProvider.kt +++ b/app/src/main/java/org/mozilla/fenix/perf/StartupStateProvider.kt @@ -112,6 +112,7 @@ class StartupStateProvider( } val afterLastStopped = startupLog.log.takeLastWhile { it != LogEntry.AppStopped } + @Suppress("MagicNumber") // we take a specific number at the end of the list to compare them. val isLastActivityCreatedStillStarted = afterLastStopped.takeLast(3) == listOf( LogEntry.ActivityCreated(activityClass), LogEntry.ActivityStarted(activityClass), diff --git a/app/src/test/java/org/mozilla/fenix/perf/StartupStateProviderTest.kt b/app/src/test/java/org/mozilla/fenix/perf/StartupStateProviderTest.kt index 3f4b0a909..dda840ac5 100644 --- a/app/src/test/java/org/mozilla/fenix/perf/StartupStateProviderTest.kt +++ b/app/src/test/java/org/mozilla/fenix/perf/StartupStateProviderTest.kt @@ -56,7 +56,7 @@ class StartupStateProviderTest { } @Test - fun `GIVEN the app started for an activity WHEN hot start THEN cold start is false` () { + fun `GIVEN the app started for an activity WHEN hot start THEN cold start is false`() { forEachHotStartEntries { index -> assertFalse("$index", provider.isColdStartForStartedActivity(homeActivityClass)) } @@ -77,7 +77,7 @@ class StartupStateProviderTest { } @Test - fun `GIVEN the app started for an activity WHEN is hot start THEN warm start is false` () { + fun `GIVEN the app started for an activity WHEN is hot start THEN warm start is false`() { forEachHotStartEntries { index -> assertFalse("$index", provider.isWarmStartForStartedActivity(homeActivityClass)) } @@ -98,7 +98,7 @@ class StartupStateProviderTest { } @Test - fun `GIVEN the app started for an activity WHEN is hot start THEN hot start is true` () { + fun `GIVEN the app started for an activity WHEN is hot start THEN hot start is true`() { forEachHotStartEntries { index -> assertTrue("$index", provider.isHotStartForStartedActivity(homeActivityClass)) }