diff --git a/media/benchmark/src/androidTest/java/com/google/android/horologist/media/benchmark/BaselineProfile.kt b/media/benchmark/src/androidTest/java/com/google/android/horologist/media/benchmark/BaselineProfile.kt deleted file mode 100644 index 197ed15c2a..0000000000 --- a/media/benchmark/src/androidTest/java/com/google/android/horologist/media/benchmark/BaselineProfile.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.benchmark - -import androidx.test.ext.junit.runners.AndroidJUnit4 -import org.junit.runner.RunWith - -// This test generates a baseline profile rules file that can be added to the app to configure -// the classes and methods that are pre-compiled at installation time, rather than JIT'd at runtime. -// 1) Run this test on a device -// 2) Copy the generated file to your workspace - command is output as part of the test: -// `adb pull "/sdcard/Android/media/com.example.android.wearable.composeadvanced.benchmark/" -// "additional_test_output/BaselineProfile_profile-baseline-prof-2022-03-25-16-58-49.txt" -// .` -// 3) Add the rules as androidMain/baseline-prof.txt -// Note that Compose libraries have profile rules already so the main benefit is to add any -// rules that are specific to classes and methods in your own app and library code. -@RunWith(AndroidJUnit4::class) -class BaselineProfile : BaseMediaBaselineProfile() { - override val mediaApp: MediaApp = TestMedia.MediaSampleApp -} diff --git a/media/benchmark/src/androidTest/java/com/google/android/horologist/media/benchmark/PlaybackBenchmark.kt b/media/benchmark/src/androidTest/java/com/google/android/horologist/media/benchmark/PlaybackBenchmark.kt deleted file mode 100644 index 6635a328c2..0000000000 --- a/media/benchmark/src/androidTest/java/com/google/android/horologist/media/benchmark/PlaybackBenchmark.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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. - */ - -@file:OptIn(ExperimentalMacrobenchmarkApi::class) - -package com.google.android.horologist.media.benchmark - -import androidx.benchmark.macro.ExperimentalMacrobenchmarkApi -import androidx.test.filters.LargeTest - -@LargeTest -class PlaybackBenchmark : BasePlaybackBenchmark() { - override val mediaApp: MediaApp = TestMedia.MediaSampleApp -} diff --git a/media/benchmark/src/androidTest/java/com/google/android/horologist/media/benchmark/QueryApp.kt b/media/benchmark/src/androidTest/java/com/google/android/horologist/media/benchmark/QueryApp.kt deleted file mode 100644 index 03881abe3e..0000000000 --- a/media/benchmark/src/androidTest/java/com/google/android/horologist/media/benchmark/QueryApp.kt +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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.benchmark - -import androidx.media3.session.MediaBrowser -import androidx.test.filters.LargeTest -import com.google.common.util.concurrent.ListenableFuture -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.runBlocking -import org.junit.Test - -@LargeTest -class QueryApp { - - private lateinit var mediaControllerFuture: ListenableFuture - - @Test - fun startup() { - mediaControllerFuture = MediaControllerHelper.lookupController( - TestMedia.MediaSampleApp.playerComponentName, - ) - - // Wait for service - val mediaController = mediaControllerFuture.get() - - runBlocking(Dispatchers.Main) { - val mediaItem = mediaController.currentMediaItem - - if (mediaItem == null) { - println("mediaItem: null") - } else { - println("uri: ${mediaItem.localConfiguration?.uri}") - println("id: ${mediaItem.mediaId}") - println("title: ${mediaItem.mediaMetadata.title}") - println("title: ${mediaItem.mediaMetadata.artist}") - } - } - } -} diff --git a/media/benchmark/src/androidTest/java/com/google/android/horologist/media/benchmark/StartupBenchmark.kt b/media/benchmark/src/androidTest/java/com/google/android/horologist/media/benchmark/StartupBenchmark.kt deleted file mode 100644 index 9e07a9a53e..0000000000 --- a/media/benchmark/src/androidTest/java/com/google/android/horologist/media/benchmark/StartupBenchmark.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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.benchmark - -import androidx.benchmark.macro.CompilationMode -import androidx.test.filters.LargeTest -import org.junit.runner.RunWith -import org.junit.runners.Parameterized - -@LargeTest -@RunWith(Parameterized::class) -class StartupBenchmark( - override val compilationMode: CompilationMode, -) : BaseStartupBenchmark() { - override val mediaApp: MediaApp = TestMedia.MediaSampleApp - - companion object { - @Parameterized.Parameters(name = "compilation={0}") - @JvmStatic - fun parameters() = listOf(CompilationMode.None(), CompilationMode.Partial()) - } -} diff --git a/media/benchmark/src/androidTest/java/com/google/android/horologist/media/benchmark/TestMedia.kt b/media/benchmark/src/androidTest/java/com/google/android/horologist/media/benchmark/TestMedia.kt deleted file mode 100644 index 1b1cae8d7a..0000000000 --- a/media/benchmark/src/androidTest/java/com/google/android/horologist/media/benchmark/TestMedia.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.benchmark - -import com.google.android.horologist.media.benchmark.MediaItems.buildMediaItem - -object TestMedia { - val Intro = buildMediaItem( - "1", - "https://storage.googleapis.com/uamp/The_Kyoto_Connection_-_Wake_Up/01_-_Intro_-_The_Way_Of_Waking_Up_feat_Alan_Watts.mp3", - "https://storage.googleapis.com/uamp/The_Kyoto_Connection_-_Wake_Up/art.jpg", - "Intro - The Way Of Waking Up (feat. Alan Watts)", - "The Kyoto Connection", - ) - - val MediaSampleApp = MediaApp( - "com.google.android.horologist.mediasample", - "com.google.android.horologist.mediasample.data.service.playback.PlaybackService", - listOf(Intro, Intro, Intro), - ) -} diff --git a/media/sample/build.gradle.kts b/media/sample/build.gradle.kts index df33135840..d95145ad55 100644 --- a/media/sample/build.gradle.kts +++ b/media/sample/build.gradle.kts @@ -196,9 +196,6 @@ dependencies { implementation(libs.androidx.datastore) implementation(libs.protobuf.kotlin.lite) - add("benchmarkImplementation", libs.androidx.tracing.perfetto) - add("benchmarkImplementation", libs.androidx.tracing.perfetto.binary) - implementation(libs.androidx.complications.datasource.ktx) implementation(libs.coil)