summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-03-23 22:53:46 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-03-23 22:53:46 +0000
commite7efc1b20e644ff622b8f9f042afa34b2a4452ad (patch)
treebed6a2647f9356e356bb64f48f9819b9aaff3f3b /tests
parenta7de2b43f64463282a07dfa9377e8292e4491d86 (diff)
parent6a5a04fa4fcd71b1448cc6499599b8935f246b6a (diff)
Merge "hotspot2: use android.graphics.drawable.Icon for Passpoint icon data"
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java
index bdaf733c1..32209a357 100644
--- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java
@@ -22,7 +22,8 @@ import static android.net.wifi.WifiManager.ACTION_PASSPOINT_SUBSCRIPTION_REMEDIA
import static android.net.wifi.WifiManager.EXTRA_BSSID_LONG;
import static android.net.wifi.WifiManager.EXTRA_DELAY;
import static android.net.wifi.WifiManager.EXTRA_ESS;
-import static android.net.wifi.WifiManager.EXTRA_ICON_INFO;
+import static android.net.wifi.WifiManager.EXTRA_FILENAME;
+import static android.net.wifi.WifiManager.EXTRA_ICON;
import static android.net.wifi.WifiManager.EXTRA_SUBSCRIPTION_REMEDIATION_METHOD;
import static android.net.wifi.WifiManager.EXTRA_URL;
@@ -44,8 +45,8 @@ import static org.mockito.MockitoAnnotations.initMocks;
import android.content.Context;
import android.content.Intent;
+import android.graphics.drawable.Icon;
import android.net.wifi.EAPConstants;
-import android.net.wifi.IconInfo;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiEnterpriseConfig;
@@ -151,10 +152,15 @@ public class PasspointManagerTest {
assertEquals(ACTION_PASSPOINT_ICON, intent.getValue().getAction());
assertTrue(intent.getValue().getExtras().containsKey(EXTRA_BSSID_LONG));
assertEquals(bssid, intent.getValue().getExtras().getLong(EXTRA_BSSID_LONG));
- assertTrue(intent.getValue().getExtras().containsKey(EXTRA_ICON_INFO));
- IconInfo expectedInfo = new IconInfo(fileName, data);
- assertEquals(new IconInfo(fileName, data),
- (IconInfo) intent.getValue().getExtras().getParcelable(EXTRA_ICON_INFO));
+ assertTrue(intent.getValue().getExtras().containsKey(EXTRA_FILENAME));
+ assertEquals(fileName, intent.getValue().getExtras().getString(EXTRA_FILENAME));
+ if (data != null) {
+ assertTrue(intent.getValue().getExtras().containsKey(EXTRA_ICON));
+ Icon icon = (Icon) intent.getValue().getExtras().getParcelable(EXTRA_ICON);
+ assertTrue(Arrays.equals(data, icon.getDataBytes()));
+ } else {
+ assertFalse(intent.getValue().getExtras().containsKey(EXTRA_ICON));
+ }
}
/**