Add ApiWrapper Instance to SandboxModelContext.

The SystemShortcutTest is failing after ag/26708194 is submitted.

Bug: 341754469
Bug: 341754775
Test: Manual
Flag: None Bug fix TestFailure
Change-Id: I2e8af1a4913c245a2d5b6164476e240ece79ada8
This commit is contained in:
Anushree Ganjam
2024-05-20 16:15:02 -07:00
parent e369bd6502
commit 6c97b05562

View File

@@ -57,6 +57,7 @@ import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.util.ApiWrapper;
import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.LauncherModelHelper.SandboxModelContext;
import com.android.launcher3.util.TestSandboxModelContextWrapper;
@@ -88,6 +89,7 @@ public class SystemShortcutTest {
private PopupDataProvider mPopupDataProvider;
private AppInfo mAppInfo;
@Mock UserCache mUserCache;
@Mock ApiWrapper mApiWrapper;
@Mock BaseDragLayer mBaseDragLayer;
@Mock UserIconInfo mUserIconInfo;
@Mock LauncherActivityInfo mLauncherActivityInfo;
@@ -98,6 +100,7 @@ public class SystemShortcutTest {
public void setUp() {
MockitoAnnotations.initMocks(this);
mSandboxContext.putObject(UserCache.INSTANCE, mUserCache);
mSandboxContext.putObject(ApiWrapper.INSTANCE, mApiWrapper);
mTestContext = new TestSandboxModelContextWrapper(mSandboxContext);
mView = new View(mSandboxContext);
spyOn(mTestContext);