Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc59aa16 authored by Cassy Chun-Crogan's avatar Cassy Chun-Crogan Committed by Wenbo Jie
Browse files

[DocsUI M3] Fix AppsRowManagerTest with show_apps_row=true

Add getRes() call for the themes and the layout Id to make it
work with both flag On and Off.

Bug: 414692965
Test: atest com.android.documentsui.dirlist.AppsRowManagerTest
Flag: com.android.documentsui.flags.use_material3
Change-Id: If8b459f162b8e1e26afa9d4fef3514a678af2e08
parent 1acd0edb
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.documentsui.dirlist;

import static com.android.documentsui.util.FlagUtils.isUseMaterial3FlagEnabled;
import static com.android.documentsui.util.Material3Config.getRes;

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.TruthJUnit.assume;
@@ -113,10 +114,12 @@ public class AppsRowManagerTest {
        mAppsRowManager = getAppsRowManager();

        Context context = InstrumentationRegistry.getInstrumentation().getTargetContext();
        context.setTheme(getRes(R.style.DocumentsTheme));
        context.getTheme().applyStyle(getRes(R.style.DocumentsDefaultTheme), false);
        LayoutInflater layoutInflater = LayoutInflater.from(context);
        mState = new State();
        mActivity = mock(BaseActivity.class);
        mAppsRow = layoutInflater.inflate(R.layout.apps_row, null);
        mAppsRow = layoutInflater.inflate(getRes(R.layout.apps_row), null);
        mAppsGroup = mAppsRow.findViewById(R.id.apps_row);

        mState.configStore = mTestConfigStore;