Merge "WifiMigrationTest: Add test for WifiMigration.loadFromSettings" into rvc-dev

This commit is contained in:
Roshan Pius
2020-03-19 12:40:03 +00:00
committed by Android (Google) Code Review

View File

@@ -16,16 +16,9 @@
package android.net.wifi.cts;
import static org.junit.Assert.assertNotNull;
import android.net.wifi.SoftApConfiguration;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiMigration;
import android.test.AndroidTestCase;
import java.util.Arrays;
import java.util.List;
public class WifiMigrationTest extends AndroidTestCase {
private static final String TEST_SSID_UNQUOTED = "testSsid1";
@@ -49,7 +42,7 @@ public class WifiMigrationTest extends AndroidTestCase {
}
/**
* Tests {@link android.net.wifi.WifiMigration.ConfigStoreMigrationData} class.
* Tests {@link android.net.wifi.WifiMigration.SettingsMigrationData.Builder} class.
*/
public void testWifiMigrationSettingsDataBuilder() throws Exception {
if (!WifiFeature.isWifiSupported(getContext())) {
@@ -76,4 +69,15 @@ public class WifiMigrationTest extends AndroidTestCase {
assertTrue(migrationData.isVerboseLoggingEnabled());
assertEquals(TEST_SSID_UNQUOTED, migrationData.getP2pDeviceName());
}
/**
* Tests {@link android.net.wifi.WifiMigration.SettingsMigrationData} class.
*/
public void testWifiMigrationSettings() throws Exception {
try {
// ensure that this does not crash.
WifiMigration.loadFromSettings(getContext());
} catch (Exception ignore) {
}
}
}