Skip to content

Commit

Permalink
Logs
Browse files Browse the repository at this point in the history
  • Loading branch information
DzmitryFomchyn committed Mar 14, 2024
1 parent cd8a7d8 commit 4e7e6cc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,30 @@ class EvOfflineTest : BaseCoreNoCleanUpTest() {
0.0f,
) {
withoutInternet {
Log.d("Test.", "Test. request routes")

val requestResult = navigation.requestRoutes(originalTestRoute.routeOptions)
.getSuccessfulResultOrThrowException()
assertEquals(RouterOrigin.Onboard, requestResult.routerOrigin)
navigation.setNavigationRoutesAsync(requestResult.routes)

Log.d("Test.", "Test. routes requested")

assertEquals(
"onboard router doesn't add charging waypoints",
listOf(2, 2),
requestResult.routes.map { it.waypoints?.size }
)
}

Log.d("Test.", "Test. waiting update routes in online")

val onlineRoutes = navigation.routesUpdates().first {
Log.d(
"Test.",
"Test. updates: ${it.reason}, ${it.navigationRoutes.first().origin}"
)

it.reason == RoutesExtra.ROUTES_UPDATE_REASON_NEW &&
it.navigationRoutes.first().origin == RouterOrigin.Offboard
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,15 @@ suspend inline fun BaseCoreNoCleanUpTest.withMapboxNavigationAndOfflineTilesForR
historyRecorderRule = historyRecorderRule,
routeRefreshOptions = routeRefreshOptions
) { navigation ->
Log.d("Test.", "Test. loading tiles")

val tilesAreLoaded = withTimeoutOrNull(TIME_TO_LOAD_TILES) {
loadRegion(navigation, region)
true
} ?: false

Log.d("Test.", "Test. Tiles loaded: $tilesAreLoaded")

assumeTrue(
"wasn't able to load routing tiles on time, ignoring test",
tilesAreLoaded
Expand Down

0 comments on commit 4e7e6cc

Please sign in to comment.