summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Qiu <zqiu@google.com>2017-03-16 11:23:20 -0700
committerPeter Qiu <zqiu@google.com>2017-03-23 11:43:26 -0700
commit6a5a04fa4fcd71b1448cc6499599b8935f246b6a (patch)
tree0482e85f6c7e06725f9a9deb0cee04b9f95a0dfa /tests
parent7a74c36073dfe94717b24741538502f9781140cb (diff)
hotspot2: use android.graphics.drawable.Icon for Passpoint icon data
Bug: 35857805 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: I0936eb28a4e820b49cdab99fa31364696a27c0f0
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));
+ }
}
/**