-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extreme font scaling screenshot (#2213)
--------- Co-authored-by: yschimke <[email protected]>
- Loading branch information
Showing
9 changed files
with
234 additions
and
72 deletions.
There are no files selected for viewing
117 changes: 117 additions & 0 deletions
117
media/ui/src/test/java/com/google/android/horologist/media/ui/MediaPlayerFontScaleTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
/* | ||
* Copyright 2022 The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.android.horologist.media.ui | ||
|
||
import com.google.android.horologist.media.ui.state.PlayerUiState | ||
import com.google.android.horologist.media.ui.state.model.MediaUiModel | ||
import com.google.android.horologist.media.ui.state.model.TrackPositionUiModel | ||
import com.google.android.horologist.media.ui.uamp.UampColors | ||
import com.google.android.horologist.screenshots.rng.WearDevice | ||
import com.google.android.horologist.screenshots.rng.WearDeviceScreenshotTest | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.robolectric.ParameterizedRobolectricTestRunner | ||
import org.robolectric.ParameterizedRobolectricTestRunner.Parameters | ||
import kotlin.time.Duration.Companion.seconds | ||
|
||
@RunWith(ParameterizedRobolectricTestRunner::class) | ||
class MediaPlayerFontScaleTest(device: WearDevice) : WearDeviceScreenshotTest(device) { | ||
|
||
@Test | ||
fun mediaPlayerLargeRound() { | ||
mediaPlayerScreen() | ||
} | ||
|
||
@Test | ||
fun mediaPlayerScreen() { | ||
val playerUiState = PlayerUiState( | ||
playEnabled = true, | ||
pauseEnabled = true, | ||
seekBackEnabled = true, | ||
seekForwardEnabled = true, | ||
seekInCurrentMediaItemEnabled = true, | ||
seekToPreviousEnabled = false, | ||
seekToNextEnabled = true, | ||
shuffleEnabled = false, | ||
shuffleOn = false, | ||
playPauseEnabled = true, | ||
playing = true, | ||
media = MediaUiModel.Ready( | ||
id = "", | ||
title = "Outro - Totally Here and Now (feat. Alan Watts)", | ||
subtitle = "The Kyoto Connection", | ||
), | ||
trackPositionUiModel = TrackPositionUiModel.Actual( | ||
position = 30.seconds, | ||
duration = 225.seconds, | ||
percent = 0.133f, | ||
), | ||
connected = true, | ||
) | ||
|
||
runTest { | ||
MediaPlayerTestCase( | ||
colors = UampColors, | ||
playerUiState = playerUiState, | ||
) | ||
} | ||
} | ||
|
||
companion object { | ||
@JvmStatic | ||
@Parameters | ||
fun devices() = listOf( | ||
|
||
WearDevice( | ||
id = "small_round_small", | ||
modelName = "Generic Small Round", | ||
screenSizePx = 384, | ||
density = 2.0f, | ||
fontScale = 0.94f, | ||
), | ||
WearDevice( | ||
id = "large_round_small", | ||
modelName = "Generic Large Round", | ||
screenSizePx = 454, | ||
density = 2.0f, | ||
fontScale = 0.94f, | ||
), | ||
WearDevice( | ||
id = "small_round_large", | ||
modelName = "Generic Small Round", | ||
screenSizePx = 384, | ||
density = 2.0f, | ||
fontScale = 1.24f, | ||
), | ||
WearDevice( | ||
id = "large_round_large", | ||
modelName = "Generic Large Round", | ||
screenSizePx = 454, | ||
density = 2.0f, | ||
fontScale = 1.24f, | ||
), | ||
WearDevice( | ||
id = "square_large", | ||
modelName = "Generic Large Round", | ||
screenSizePx = 360, | ||
density = 2.0f, | ||
fontScale = 1.24f, | ||
isRound = false, | ||
), | ||
) | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
media/ui/src/test/screenshots/MediaPlayerFontScaleTest_large_round_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
media/ui/src/test/screenshots/MediaPlayerFontScaleTest_large_round_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
media/ui/src/test/screenshots/MediaPlayerFontScaleTest_small_round_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
media/ui/src/test/screenshots/MediaPlayerFontScaleTest_small_round_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
media/ui/src/test/screenshots/MediaPlayerFontScaleTest_square_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters