Search in sources :

Example 26 with Slice

use of androidx.slice.Slice in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class DeviceInfoSliceTest method getSlice_hasNoSubscriptionInfo_shouldShowUnknown.

@Test
public void getSlice_hasNoSubscriptionInfo_shouldShowUnknown() {
    final Slice slice = mDeviceInfoSlice.getSlice();
    final SliceMetadata metadata = SliceMetadata.from(mContext, slice);
    assertThat(metadata.getTitle()).isEqualTo(mContext.getString(R.string.device_info_label));
    final List<SliceItem> sliceItems = slice.getItems();
    SliceTester.assertAnySliceItemContainsTitle(sliceItems, mContext.getString(R.string.device_info_default));
}
Also used : Slice(androidx.slice.Slice) SliceMetadata(androidx.slice.SliceMetadata) SliceItem(androidx.slice.SliceItem) Test(org.junit.Test)

Example 27 with Slice

use of androidx.slice.Slice in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class BluetoothDevicesSliceTest method getSlice_hasBluetoothDevices_shouldHaveBluetoothDevicesTitle.

@Test
public void getSlice_hasBluetoothDevices_shouldHaveBluetoothDevicesTitle() {
    mockBluetoothDeviceList(1);
    doReturn(mBluetoothDeviceList).when(mBluetoothDevicesSlice).getConnectedBluetoothDevices();
    final Slice slice = mBluetoothDevicesSlice.getSlice();
    final SliceMetadata metadata = SliceMetadata.from(mContext, slice);
    assertThat(metadata.getTitle()).isEqualTo(mContext.getString(R.string.bluetooth_devices));
}
Also used : Slice(androidx.slice.Slice) SliceMetadata(androidx.slice.SliceMetadata) Test(org.junit.Test)

Example 28 with Slice

use of androidx.slice.Slice in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class BluetoothDevicesSliceTest method getSlice_noBluetoothDevices_shouldHaveNoBluetoothDevicesTitle.

@Test
public void getSlice_noBluetoothDevices_shouldHaveNoBluetoothDevicesTitle() {
    doReturn(mBluetoothDeviceList).when(mBluetoothDevicesSlice).getConnectedBluetoothDevices();
    final Slice slice = mBluetoothDevicesSlice.getSlice();
    final SliceMetadata metadata = SliceMetadata.from(mContext, slice);
    assertThat(metadata.getTitle()).isEqualTo(mContext.getString(R.string.no_bluetooth_devices));
}
Also used : Slice(androidx.slice.Slice) SliceMetadata(androidx.slice.SliceMetadata) Test(org.junit.Test)

Example 29 with Slice

use of androidx.slice.Slice in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ContextualAdaptiveSleepSliceTest method getSlice_ShowIfFeatureIsAvailable.

@Test
public void getSlice_ShowIfFeatureIsAvailable() {
    final Slice slice = mContextualAdaptiveSleepSlice.getSlice();
    assertThat(slice).isNotNull();
}
Also used : Slice(androidx.slice.Slice) Test(org.junit.Test)

Example 30 with Slice

use of androidx.slice.Slice in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ContextualAdaptiveSleepSliceTest method getSlice_ShowIfNotTurnedOn.

@Test
public void getSlice_ShowIfNotTurnedOn() {
    final Slice slice = mContextualAdaptiveSleepSlice.getSlice();
    assertThat(slice).isNotNull();
}
Also used : Slice(androidx.slice.Slice) Test(org.junit.Test)

Aggregations

Slice (androidx.slice.Slice)216 Test (org.junit.Test)204 SliceMetadata (androidx.slice.SliceMetadata)73 SliceAction (androidx.slice.core.SliceAction)28 SliceItem (androidx.slice.SliceItem)22 Config (org.robolectric.annotation.Config)20 Uri (android.net.Uri)17 ParceledListSlice (android.content.pm.ParceledListSlice)14 IconCompat (androidx.core.graphics.drawable.IconCompat)14 ContextualWifiSlice (com.android.settings.wifi.slice.ContextualWifiSlice)9 PrivateStorageInfo (com.android.settingslib.deviceinfo.PrivateStorageInfo)9 UiThreadTest (androidx.test.annotation.UiThreadTest)8 VisibleForTesting (androidx.annotation.VisibleForTesting)5 EmergencyInfoSlice (com.android.settings.homepage.contextualcards.deviceinfo.EmergencyInfoSlice)5 ArrayList (java.util.ArrayList)5 PendingIntent (android.app.PendingIntent)4 Intent (android.content.Intent)4 BatteryTip (com.android.settings.fuelgauge.batterytip.tips.BatteryTip)4 EarlyWarningTip (com.android.settings.fuelgauge.batterytip.tips.EarlyWarningTip)4 LowBatteryTip (com.android.settings.fuelgauge.batterytip.tips.LowBatteryTip)4