Clean up ignored tests in Settings Slices provider.
Change-Id: Iad9102a5d23333d64976e0697f9438bccc77af0a Bug: 253386051
This commit is contained in:
@@ -61,12 +61,9 @@ import com.android.settings.testutils.shadow.ShadowLockPatternUtils;
|
|||||||
import com.android.settings.testutils.shadow.ShadowThreadUtils;
|
import com.android.settings.testutils.shadow.ShadowThreadUtils;
|
||||||
import com.android.settings.testutils.shadow.ShadowUserManager;
|
import com.android.settings.testutils.shadow.ShadowUserManager;
|
||||||
import com.android.settings.testutils.shadow.ShadowUtils;
|
import com.android.settings.testutils.shadow.ShadowUtils;
|
||||||
import com.android.settings.wifi.slice.WifiScanWorker;
|
|
||||||
import com.android.settingslib.wifi.WifiTracker;
|
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
@@ -100,7 +97,6 @@ import java.util.Set;
|
|||||||
@Config(shadows = {ShadowUserManager.class, ShadowUtils.class,
|
@Config(shadows = {ShadowUserManager.class, ShadowUtils.class,
|
||||||
SlicesDatabaseAccessorTest.ShadowApplicationPackageManager.class,
|
SlicesDatabaseAccessorTest.ShadowApplicationPackageManager.class,
|
||||||
ShadowBluetoothAdapter.class, ShadowLockPatternUtils.class,
|
ShadowBluetoothAdapter.class, ShadowLockPatternUtils.class,
|
||||||
SettingsSliceProviderTest.ShadowWifiScanWorker.class,
|
|
||||||
SettingsSliceProviderTest.ShadowTheme.class})
|
SettingsSliceProviderTest.ShadowTheme.class})
|
||||||
public class SettingsSliceProviderTest {
|
public class SettingsSliceProviderTest {
|
||||||
|
|
||||||
@@ -123,6 +119,7 @@ public class SettingsSliceProviderTest {
|
|||||||
private Context mContext;
|
private Context mContext;
|
||||||
private SettingsSliceProvider mProvider;
|
private SettingsSliceProvider mProvider;
|
||||||
private ShadowPackageManager mPackageManager;
|
private ShadowPackageManager mPackageManager;
|
||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
private SliceManager mManager;
|
private SliceManager mManager;
|
||||||
|
|
||||||
@@ -572,14 +569,6 @@ public class SettingsSliceProviderTest {
|
|||||||
assertThat(pendingIntent).isEqualTo(settingsPendingIntent);
|
assertThat(pendingIntent).isEqualTo(settingsPendingIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@Ignore
|
|
||||||
public void bindSlice_wifiSlice_returnsWifiSlice() {
|
|
||||||
final Slice wifiSlice = mProvider.onBindSlice(CustomSliceRegistry.WIFI_SLICE_URI);
|
|
||||||
|
|
||||||
assertThat(wifiSlice.getUri()).isEqualTo(CustomSliceRegistry.WIFI_SLICE_URI);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void bindSlice_flashlightSlice_returnsFlashlightSlice() {
|
public void bindSlice_flashlightSlice_returnsFlashlightSlice() {
|
||||||
Settings.Secure.putInt(
|
Settings.Secure.putInt(
|
||||||
@@ -603,32 +592,6 @@ public class SettingsSliceProviderTest {
|
|||||||
mProvider.onSlicePinned(uri);
|
mProvider.onSlicePinned(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@Ignore
|
|
||||||
public void onSlicePinned_backgroundWorker_started() {
|
|
||||||
mProvider.onSlicePinned(CustomSliceRegistry.WIFI_SLICE_URI);
|
|
||||||
|
|
||||||
verify(ShadowWifiScanWorker.getWifiTracker()).onStart();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Ignore
|
|
||||||
public void onSlicePinned_backgroundWorker_stopped() {
|
|
||||||
mProvider.onSlicePinned(CustomSliceRegistry.WIFI_SLICE_URI);
|
|
||||||
mProvider.onSliceUnpinned(CustomSliceRegistry.WIFI_SLICE_URI);
|
|
||||||
|
|
||||||
verify(ShadowWifiScanWorker.getWifiTracker()).onStop();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Ignore
|
|
||||||
public void shutdown_backgroundWorker_closed() {
|
|
||||||
mProvider.onSlicePinned(CustomSliceRegistry.WIFI_SLICE_URI);
|
|
||||||
mProvider.shutdown();
|
|
||||||
|
|
||||||
verify(ShadowWifiScanWorker.getWifiTracker()).onDestroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Config(qualifiers = "mcc998")
|
@Config(qualifiers = "mcc998")
|
||||||
public void grantAllowlistedPackagePermissions_noAllowlist_shouldNotGrant() {
|
public void grantAllowlistedPackagePermissions_noAllowlist_shouldNotGrant() {
|
||||||
@@ -716,31 +679,6 @@ public class SettingsSliceProviderTest {
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Implements(WifiScanWorker.class)
|
|
||||||
public static class ShadowWifiScanWorker {
|
|
||||||
private static WifiTracker mWifiTracker;
|
|
||||||
|
|
||||||
@Implementation
|
|
||||||
protected void onSlicePinned() {
|
|
||||||
mWifiTracker = mock(WifiTracker.class);
|
|
||||||
mWifiTracker.onStart();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Implementation
|
|
||||||
protected void onSliceUnpinned() {
|
|
||||||
mWifiTracker.onStop();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Implementation
|
|
||||||
protected void close() {
|
|
||||||
mWifiTracker.onDestroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
static WifiTracker getWifiTracker() {
|
|
||||||
return mWifiTracker;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Implements(value = StrictMode.class)
|
@Implements(value = StrictMode.class)
|
||||||
public static class ShadowStrictMode {
|
public static class ShadowStrictMode {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user