Create robolectric tests for WifiNetworkDetailsFragment.
More tests to follow in separate CLs. Submitting test class in order to unblock parallel development. Bug: 35963536 Test: make RunSettingsRoboTests Change-Id: I50752ba0d6c53d016bf5809f7bd5d5f6e0350b90
This commit is contained in:
34
tests/robotests/src/android/net/NetworkBadging.java
Normal file
34
tests/robotests/src/android/net/NetworkBadging.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package android.net;
|
||||
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.Nullable;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
/**
|
||||
* Implementation for {@link android.net.NetworkBadging}.
|
||||
*
|
||||
* <p>Can be removed once Robolectric supports Android O.
|
||||
*/
|
||||
public class NetworkBadging {
|
||||
@IntDef({BADGING_NONE, BADGING_SD, BADGING_HD, BADGING_4K})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface Badging {}
|
||||
|
||||
public static final int BADGING_NONE = 0;
|
||||
public static final int BADGING_SD = 10;
|
||||
public static final int BADGING_HD = 20;
|
||||
public static final int BADGING_4K = 30;
|
||||
|
||||
private static Drawable drawable;
|
||||
|
||||
public static Drawable getWifiIcon(
|
||||
int signalLevel, @NetworkBadging.Badging int badging, @Nullable Resources.Theme theme) {
|
||||
return new ColorDrawable(Color.GREEN);
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package android.net.wifi;
|
||||
|
||||
/**
|
||||
* Empty class def for {@link android.net.wifi.WifiNetworkScoreCache}.
|
||||
*
|
||||
* <p>Can be removed once Robolectric supports Android O.
|
||||
*/
|
||||
public class WifiNetworkScoreCache {
|
||||
|
||||
}
|
Reference in New Issue
Block a user