Skip to content

Commit

Permalink
Fix errors during the benchmark
Browse files Browse the repository at this point in the history
Change-Id: I9b78f5e4caea39aab026c1f0d7bfa56ddb4a9784
  • Loading branch information
lihenggui committed Mar 13, 2023
1 parent 5e6f40b commit bbfedb0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .run/Generate Market Baseline Profile.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</option>
<option name="taskNames">
<list>
<option value=":benchmark:pixel6Api31atdMarketBenchmarkAndroidTest" />
<option value=":benchmark:pixel6Api31aospMarketBenchmarkAndroidTest" />
<option value="--rerun" />
<option value="--enable-display" />
</list>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ fun MacrobenchmarkScope.appListWaitForContent() {
}

fun MacrobenchmarkScope.appListScrollDownUp() {
val feedList = device.findObject(By.res("appList:applicationList"))
device.flingElementDownUp(feedList)
val list = device.findObject(By.res("appList:applicationList"))
device.flingElementDownUp(list)
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ fun MacrobenchmarkScope.goToRulesScreen() {
device.findObject(By.text("Rules")).click()
device.waitForIdle()
// Wait until saved title are shown on screen
device.wait(Until.hasObject(By.res("blockerTopAppBar")), 2_000)
val topAppBar = device.findObject(By.res("blockerTopAppBar"))
topAppBar.wait(Until.hasObject(By.text("Rules")), 2_000)
// Timeout here is quite big, because sometimes data loading takes a long time
device.wait(Until.hasObject(By.res("blockerTopAppBar")), 60_000)
device.wait(Until.hasObject(By.res("rule:list")), 60_000)
}

fun MacrobenchmarkScope.rulesScrollListDownUp() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import androidx.compose.ui.graphics.StrokeCap
import androidx.compose.ui.graphics.drawscope.rotate
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.platform.LocalInspectionMode
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -108,7 +109,8 @@ fun BlockerLoadingWheel(
.size(48.dp)
.padding(8.dp)
.graphicsLayer { rotationZ = rotationAnim }
.semantics { contentDescription = contentDesc },
.semantics { contentDescription = contentDesc }
.testTag("loadingWheel"),
) {
repeat(NUM_OF_LINES) { index ->
rotate(degrees = index * 30f) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ fun GeneralRulesScreen(
) {
Scaffold(
topBar = {
BlockerTopAppBar(title = stringResource(id = R.string.rules))
BlockerTopAppBar(
title = stringResource(id = R.string.rules),
modifier = Modifier.testTag("blockerTopAppBar"),
)
},
) { padding ->
Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.tooling.preview.Preview
import androidx.hilt.navigation.compose.hiltViewModel
Expand Down Expand Up @@ -140,6 +141,7 @@ fun SearchScreen(
onSelectAll = onSelectAll,
onBlockAll = onBlockAll,
onCheckAll = onCheckAll,
modifier = Modifier.testTag("blockerTopAppBar"),
)
},
) { padding ->
Expand Down

0 comments on commit bbfedb0

Please sign in to comment.