File tree Expand file tree Collapse file tree 8 files changed +12
-33
lines changed
app-nia-catalog/dependencies
src/main/kotlin/com/google/samples/apps/nowinandroid Expand file tree Collapse file tree 8 files changed +12
-33
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0
6868androidx.lifecycle:lifecycle-viewmodel-savedstate:2.7.0
6969androidx.lifecycle:lifecycle-viewmodel:2.7.0
7070androidx.loader:loader:1.0.0
71- androidx.metrics:metrics-performance:1.0.0-beta01
71+ androidx.metrics:metrics-performance:1.0.0-alpha04
7272androidx.profileinstaller:profileinstaller:1.3.1
7373androidx.savedstate:savedstate-ktx:1.2.1
7474androidx.savedstate:savedstate:1.2.1
Original file line number Diff line number Diff line change @@ -52,7 +52,9 @@ android {
5252 // To publish on the Play store a private signing key is required, but to allow anyone
5353 // who clones the code to sign and run the release variant, use the debug signing key.
5454 // TODO: Abstract the signing configuration to a separate file to avoid hardcoding this.
55- signingConfig = signingConfigs.getByName(" debug" )
55+ signingConfig = signingConfigs.named(" debug" ).get()
56+ // Ensure Baseline Profile is fresh for release builds.
57+ baselineProfile.automaticGenerationDuringBuild = true
5658 }
5759 }
5860
@@ -69,20 +71,6 @@ android {
6971 namespace = " com.google.samples.apps.nowinandroid"
7072}
7173
72- baselineProfile {
73- saveInSrc = false
74- // Don't build on every iteration of a full assemble.
75- // Instead enable generation directly for the release build variant.
76- automaticGenerationDuringBuild = false
77- mergeIntoMain = true
78- variants {
79- create(" release" ) {
80- // Ensure Baseline Profile is fresh for release builds.
81- automaticGenerationDuringBuild = true
82- }
83- }
84- }
85-
8674dependencies {
8775 implementation(projects.feature.interests)
8876 implementation(projects.feature.foryou)
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.0-alpha04
102102androidx.lifecycle:lifecycle-viewmodel:2.8.0-alpha04
103103androidx.loader:loader:1.0.0
104104androidx.localbroadcastmanager:localbroadcastmanager:1.0.0
105- androidx.metrics:metrics-performance:1.0.0-beta01
105+ androidx.metrics:metrics-performance:1.0.0-alpha04
106106androidx.navigation:navigation-common-ktx:2.7.4
107107androidx.navigation:navigation-common:2.7.4
108108androidx.navigation:navigation-compose:2.7.4
Original file line number Diff line number Diff line change 1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16- import com.android.build.api.dsl.ManagedVirtualDevice
1716import com.google.samples.apps.nowinandroid.configureFlavors
1817
1918plugins {
@@ -47,7 +46,7 @@ android {
4746 }
4847
4948 testOptions.managedDevices.devices {
50- create<ManagedVirtualDevice >(" pixel6Api33" ) {
49+ create< com.android.build.api.dsl. ManagedVirtualDevice > (" pixel6Api33" ) {
5150 device = " Pixel 6"
5251 apiLevel = 33
5352 systemImageSource = " aosp"
Original file line number Diff line number Diff line change @@ -41,11 +41,6 @@ fun MacrobenchmarkScope.forYouWaitForContent() {
4141 */
4242fun MacrobenchmarkScope.forYouSelectTopics (recheckTopicsIfChecked : Boolean = false) {
4343 val topics = device.findObject(By .res(" forYou:topicSelection" ))
44- val noChildren = topics.childCount == 0
45- if (noChildren) {
46- // TODO: Ensure ForYou has topics.
47- fail(" No topics found, can't scroll for baseline profile generation." )
48- }
4944
5045 // Set gesture margin from sides not to trigger system gesture navigation
5146 val horizontalMargin = 10 * topics.visibleBounds.width() / 100
@@ -56,6 +51,9 @@ fun MacrobenchmarkScope.forYouSelectTopics(recheckTopicsIfChecked: Boolean = fal
5651 var visited = 0
5752
5853 while (visited < 3 ) {
54+ if (topics.childCount == 0 ) {
55+ fail(" No topics found, can't generate profile for ForYou page." )
56+ }
5957 // Selecting some topics, which will populate items in the feed.
6058 val topic = topics.children[index % topics.childCount]
6159 // Find the checkable element to figure out whether it's checked or not
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ import androidx.test.uiautomator.By
2121import androidx.test.uiautomator.Until
2222import com.google.samples.apps.nowinandroid.flingElementDownUp
2323import com.google.samples.apps.nowinandroid.waitForObjectOnTopAppBar
24- import org.junit.Assert.fail
2524
2625fun MacrobenchmarkScope.goToInterestsScreen () {
2726 device.findObject(By .text(" Interests" )).click()
@@ -36,12 +35,7 @@ fun MacrobenchmarkScope.goToInterestsScreen() {
3635fun MacrobenchmarkScope.interestsScrollTopicsDownUp () {
3736 device.wait(Until .hasObject(By .res(" interests:topics" )), 5_000 )
3837 val topicsList = device.findObject(By .res(" interests:topics" ))
39- if (topicsList != null ) {
40- // TODO: Ensure topics are availble.
41- device.flingElementDownUp(topicsList)
42- } else {
43- fail(" No topics found, can't scroll during baseline profile generation." )
44- }
38+ device.flingElementDownUp(topicsList)
4539}
4640
4741fun MacrobenchmarkScope.interestsWaitForTopics () {
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ androidxDataStore = "1.0.0"
1818androidxEspresso = " 3.5.1"
1919androidxHiltNavigationCompose = " 1.2.0"
2020androidxLifecycle = " 2.7.0"
21- androidxMacroBenchmark = " 1.2.4 "
22- androidxMetrics = " 1.0.0-beta01 "
21+ androidxMacroBenchmark = " 1.2.2 "
22+ androidxMetrics = " 1.0.0-alpha04 "
2323androidxNavigation = " 2.7.4"
2424androidxProfileinstaller = " 1.3.1"
2525androidxTestCore = " 1.5.0"
You can’t perform that action at this time.
0 commit comments