diff options
author | Peter Qiu <zqiu@google.com> | 2017-03-23 23:13:39 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-03-23 23:13:39 +0000 |
commit | e5be458980ba6313368341c3caf6cf614438fd81 (patch) | |
tree | 0f1d4109381c144cee6f118ea74e6dadf31fc4fd /tests | |
parent | 9af726975141f59dab95524b11c33e1d9fd16da0 (diff) | |
parent | c0b42e0f03a02a22f3b0b50c64220c640e818b2d (diff) |
Merge "hotspot2: use android.graphics.drawable.Icon for Passpoint icon data" am: e7efc1b20e am: 497c2e277d
am: c0b42e0f03
Change-Id: Ib78f5c93985ef13db11264401ecddf2acb21d421
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java | 18 |
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)); + } } /** |