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

Commit 09631b40 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add more functionality for some picker fakes" into main

parents 95d7babd 0d04228a
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -22,7 +22,9 @@ import com.android.wallpaper.network.Requester
import com.android.wallpaper.picker.category.wrapper.WallpaperCategoryWrapper
import com.android.wallpaper.picker.customization.data.repository.WallpaperColorsRepository
import com.android.wallpaper.picker.customization.domain.interactor.WallpaperInteractor
import com.android.wallpaper.testing.FakeCurrentWallpaperInfoFactory
import com.android.wallpaper.testing.FakeWallpaperClient
import com.android.wallpaper.testing.FakeWallpaperRefresher
import com.android.wallpaper.testing.TestInjector
import com.android.wallpaper.testing.TestPackageStatusNotifier
import com.android.wallpaper.util.DisplayUtils
@@ -43,7 +45,9 @@ constructor(
    injectedWallpaperInteractor: WallpaperInteractor,
    prefs: WallpaperPreferences,
    private val fakeWallpaperCategoryWrapper: WallpaperCategoryWrapper,
    private val testStatusNotifier: TestPackageStatusNotifier,
    testStatusNotifier: TestPackageStatusNotifier,
    currentWallpaperInfoFactory: FakeCurrentWallpaperInfoFactory,
    wallpaperRefresher: FakeWallpaperRefresher,
) :
    TestInjector(
        themesUserEventLogger,
@@ -56,6 +60,8 @@ constructor(
        prefs,
        fakeWallpaperCategoryWrapper,
        testStatusNotifier,
        currentWallpaperInfoFactory,
        wallpaperRefresher,
    ),
    CustomizationInjector {
    /////////////////
+10 −5
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import com.android.themepicker.R
import com.android.wallpaper.module.InjectorProvider
import com.android.wallpaper.module.NetworkStatusNotifier
import com.android.wallpaper.module.PartnerProvider
import com.android.wallpaper.module.WallpaperPreferences
import com.android.wallpaper.network.Requester
import com.android.wallpaper.picker.category.wrapper.WallpaperCategoryWrapper
import com.android.wallpaper.picker.common.icon.ui.viewmodel.Icon
@@ -43,8 +42,9 @@ import com.android.wallpaper.picker.common.text.ui.viewmodel.Text
import com.android.wallpaper.picker.customization.data.repository.WallpaperRepository
import com.android.wallpaper.picker.customization.domain.interactor.WallpaperInteractor
import com.android.wallpaper.picker.option.ui.viewmodel.OptionItemViewModel
import com.android.wallpaper.testing.FakeCurrentWallpaperInfoFactory
import com.android.wallpaper.testing.FakeWallpaperClient
import com.android.wallpaper.testing.TestCurrentWallpaperInfoFactory
import com.android.wallpaper.testing.FakeWallpaperRefresher
import com.android.wallpaper.testing.TestInjector
import com.android.wallpaper.testing.TestPackageStatusNotifier
import com.android.wallpaper.testing.TestWallpaperPreferences
@@ -90,6 +90,9 @@ class KeyguardQuickAffordancePickerViewModelTest {
        testScope = TestScope(testDispatcher)
        Dispatchers.setMain(testDispatcher)
        client = FakeCustomizationProviderClient()
        val prefs = TestWallpaperPreferences()
        val refresher = FakeWallpaperRefresher(prefs)
        val wallpaperInfoFactory = FakeCurrentWallpaperInfoFactory(refresher)

        quickAffordanceInteractor =
            KeyguardQuickAffordancePickerInteractor(
@@ -107,7 +110,7 @@ class KeyguardQuickAffordancePickerViewModelTest {
                    WallpaperRepository(
                        scope = testScope.backgroundScope,
                        client = FakeWallpaperClient(),
                        wallpaperPreferences = TestWallpaperPreferences(),
                        wallpaperPreferences = prefs,
                        backgroundDispatcher = testDispatcher,
                    )
            )
@@ -121,9 +124,11 @@ class KeyguardQuickAffordancePickerViewModelTest {
                mock(PartnerProvider::class.java),
                FakeWallpaperClient(),
                wallpaperInteractor,
                mock(WallpaperPreferences::class.java),
                prefs,
                mock(WallpaperCategoryWrapper::class.java),
                testPackageStatusNotifier,
                wallpaperInfoFactory,
                refresher,
            )
        )
        underTest =
@@ -131,7 +136,7 @@ class KeyguardQuickAffordancePickerViewModelTest {
                    context = context,
                    quickAffordanceInteractor = quickAffordanceInteractor,
                    wallpaperInteractor = wallpaperInteractor,
                    wallpaperInfoFactory = TestCurrentWallpaperInfoFactory(context),
                    wallpaperInfoFactory = wallpaperInfoFactory,
                    logger = logger,
                )
                .create(KeyguardQuickAffordancePickerViewModel::class.java)