From ec65737cbbfc79f86af036c8be036431f6efc520 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Wed, 14 Apr 2021 08:25:57 -0700 Subject: [PATCH] For #18836: address lint errors for StartupStateProvider*. --- .../java/org/mozilla/fenix/perf/StartupStateProvider.kt | 1 + .../java/org/mozilla/fenix/perf/StartupStateProviderTest.kt | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) 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)) }