Set extraInfo on cellular TestNetworkAgents.
This makes the test more realistic, since telephony always puts the APN name in the extraInfo field. It also makes it easy to test that various APIs properly return the extra info without plumbing a new parameter through TestNetworkAgentWrapper, NetworkAgentWrapper, and InstrumentedNetworkAgent. Also make the extraInfo and the legacyType available to tests. This will be used in future tests that assert the contents of extraInfo. Bug: 181855958 Test: test-only change Change-Id: If4eddb6cd9e70bb33e10d72aceebaea843244246
This commit is contained in:
@@ -720,7 +720,7 @@ public class ConnectivityServiceTest {
|
||||
|
||||
@Override
|
||||
protected InstrumentedNetworkAgent makeNetworkAgent(LinkProperties linkProperties,
|
||||
final int type, final String typeName) throws Exception {
|
||||
NetworkAgentConfig nac) throws Exception {
|
||||
mNetworkMonitor = mock(INetworkMonitor.class);
|
||||
|
||||
final Answer validateAnswer = inv -> {
|
||||
@@ -739,8 +739,8 @@ public class ConnectivityServiceTest {
|
||||
any() /* name */,
|
||||
nmCbCaptor.capture());
|
||||
|
||||
final InstrumentedNetworkAgent na = new InstrumentedNetworkAgent(this, linkProperties,
|
||||
type, typeName) {
|
||||
final InstrumentedNetworkAgent na =
|
||||
new InstrumentedNetworkAgent(this, linkProperties, nac) {
|
||||
@Override
|
||||
public void networkStatus(int status, String redirectUrl) {
|
||||
mRedirectUrl = redirectUrl;
|
||||
|
||||
Reference in New Issue
Block a user