Adding a mock for MSDLPlayerWrapper to DeleteDropTargetTest.

The mock makes sure we don't rely on a device hardware for tests.

Test: DeleteDropTargetTest
Flag: com.android.launcher3.msdl_feedback
Bug: 379958544
Change-Id: I202b81f3dd16af1c0985980d0b962be0000bf31f
This commit is contained in:
Juan Sebastian Martinez
2024-11-21 09:58:33 -08:00
parent 9241d291aa
commit 86f3d35839
3 changed files with 17 additions and 5 deletions
@@ -65,7 +65,7 @@ public abstract class ButtonDropTarget extends TextView
protected final ActivityContext mActivityContext;
protected final DropTargetHandler mDropTargetHandler;
protected DropTargetBar mDropTargetBar;
private final MSDLPlayerWrapper mMSDLPlayerWrapper;
private MSDLPlayerWrapper mMSDLPlayerWrapper;
/** Whether this drop target is active for the current drag */
protected boolean mActive;
@@ -438,6 +438,11 @@ public abstract class ButtonDropTarget extends TextView
return textHeight + getPaddingTop() + getPaddingBottom() >= availableHeight;
}
@VisibleForTesting
public void setMSDLPlayerWrapper(MSDLPlayerWrapper wrapper) {
mMSDLPlayerWrapper = wrapper;
}
/**
* Reduce the size of the text until it fits the measured width or reaches a minimum.
*