Merge "Remove mocked resources from slice test cases"

This commit is contained in:
Fan Zhang
2018-10-10 20:13:52 +00:00
committed by Android (Google) Code Review
9 changed files with 1 additions and 69 deletions

View File

@@ -20,14 +20,11 @@ import static android.app.slice.Slice.EXTRA_TOGGLE_STATE;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.provider.Settings;
import androidx.slice.Slice;
@@ -60,11 +57,6 @@ public class ZenModeSliceBuilderTest {
public void setUp() {
mContext = spy(RuntimeEnvironment.application);
// Prevent crash in SliceMetadata.
Resources resources = spy(mContext.getResources());
doReturn(60).when(resources).getDimensionPixelSize(anyInt());
doReturn(resources).when(mContext).getResources();
// Set-up specs for SliceMetadata.
SliceProvider.setSpecs(SliceLiveData.SUPPORTED_SPECS);
}