@ -25,7 +25,6 @@ import org.mozilla.fenix.helpers.HomeActivityTestRule
private const val EXPECTED _SUPPRESSION _COUNT = 19
private const val EXPECTED _SUPPRESSION _COUNT = 19
@Suppress ( " TopLevelPropertyNaming " ) // it's silly this would have a different naming convention b/c no const
@Suppress ( " TopLevelPropertyNaming " ) // it's silly this would have a different naming convention b/c no const
private val EXPECTED _RUNBLOCKING _RANGE = 0. . 1 // CI has +1 counts compared to local runs: increment these together
private val EXPECTED _RUNBLOCKING _RANGE = 0. . 1 // CI has +1 counts compared to local runs: increment these together
private const val EXPECTED _COMPONENT _INIT _COUNT = 50
private const val EXPECTED _VIEW _HIERARCHY _DEPTH = 12
private const val EXPECTED _VIEW _HIERARCHY _DEPTH = 12
private const val EXPECTED _RECYCLER _VIEW _CONSTRAINT _LAYOUT _CHILDREN = 4
private const val EXPECTED _RECYCLER _VIEW _CONSTRAINT _LAYOUT _CHILDREN = 4
private const val EXPECTED _NUMBER _OF _INFLATION = 12
private const val EXPECTED _NUMBER _OF _INFLATION = 12
@ -40,11 +39,6 @@ private val failureMsgRunBlocking = getErrorMessage(
implications = " using runBlocking may block the main thread and have other negative performance implications? "
implications = " using runBlocking may block the main thread and have other negative performance implications? "
)
)
private val failureMsgComponentInit = getErrorMessage (
shortName = " Component init " ,
implications = " initializing new components on start up may be an indication that we're doing more work than necessary on start up? "
)
private val failureMsgViewHierarchyDepth = getErrorMessage (
private val failureMsgViewHierarchyDepth = getErrorMessage (
shortName = " view hierarchy depth " ,
shortName = " view hierarchy depth " ,
implications = " having a deep view hierarchy can slow down measure/layout performance? "
implications = " having a deep view hierarchy can slow down measure/layout performance? "
@ -93,7 +87,6 @@ class StartupExcessiveResourceUseTest {
// causing this number to fluctuate depending on device speed. We'll deal with it if it occurs.
// causing this number to fluctuate depending on device speed. We'll deal with it if it occurs.
val actualSuppresionCount = activityTestRule . activity . components . strictMode . suppressionCount . get ( ) . toInt ( )
val actualSuppresionCount = activityTestRule . activity . components . strictMode . suppressionCount . get ( ) . toInt ( )
val actualRunBlocking = RunBlockingCounter . count . get ( )
val actualRunBlocking = RunBlockingCounter . count . get ( )
val actualComponentInitCount = ComponentInitCount . count . get ( )
val rootView = activityTestRule . activity . findViewById < LinearLayout > ( R . id . rootContainer )
val rootView = activityTestRule . activity . findViewById < LinearLayout > ( R . id . rootContainer )
val actualViewHierarchyDepth = countAndLogViewHierarchyDepth ( rootView , 1 )
val actualViewHierarchyDepth = countAndLogViewHierarchyDepth ( rootView , 1 )
@ -103,7 +96,6 @@ class StartupExcessiveResourceUseTest {
assertEquals ( failureMsgStrictMode , EXPECTED _SUPPRESSION _COUNT , actualSuppresionCount )
assertEquals ( failureMsgStrictMode , EXPECTED _SUPPRESSION _COUNT , actualSuppresionCount )
assertTrue ( failureMsgRunBlocking + " actual: $actualRunBlocking " , actualRunBlocking in EXPECTED _RUNBLOCKING _RANGE )
assertTrue ( failureMsgRunBlocking + " actual: $actualRunBlocking " , actualRunBlocking in EXPECTED _RUNBLOCKING _RANGE )
assertEquals ( failureMsgComponentInit , EXPECTED _COMPONENT _INIT _COUNT , actualComponentInitCount )
assertEquals ( failureMsgViewHierarchyDepth , EXPECTED _VIEW _HIERARCHY _DEPTH , actualViewHierarchyDepth )
assertEquals ( failureMsgViewHierarchyDepth , EXPECTED _VIEW _HIERARCHY _DEPTH , actualViewHierarchyDepth )
assertEquals (
assertEquals (
failureMsgRecyclerViewConstraintLayoutChildren ,
failureMsgRecyclerViewConstraintLayoutChildren ,