Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Unified Diff: net/android/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java

Issue 2160263002: Use supported Android network handles in Android M and newer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment parseInt Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/android/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java
diff --git a/net/android/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java b/net/android/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java
index bd893476ba669d7776bf060d3cb28aac5a064e53..8d6aa8e9fe9d736c4c5690e949264937f4ac98ff 100644
--- a/net/android/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java
+++ b/net/android/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java
@@ -149,7 +149,7 @@ public class NetworkChangeNotifierTest extends InstrumentationTestCase {
@Override
protected NetworkCapabilities getNetworkCapabilities(Network network) {
- int netId = NetworkChangeNotifierAutoDetect.networkToNetId(network);
+ long netId = NetworkChangeNotifierAutoDetect.networkToNetId(network);
for (MockNetwork mockNetwork : mMockNetworks) {
if (netId == mockNetwork.mNetId) {
return mockNetwork.getCapabilities();
@@ -160,7 +160,7 @@ public class NetworkChangeNotifierTest extends InstrumentationTestCase {
@Override
protected boolean vpnAccessible(Network network) {
- int netId = NetworkChangeNotifierAutoDetect.networkToNetId(network);
+ long netId = NetworkChangeNotifierAutoDetect.networkToNetId(network);
for (MockNetwork mockNetwork : mMockNetworks) {
if (netId == mockNetwork.mNetId) {
return mockNetwork.mVpnAccessible;
@@ -181,7 +181,7 @@ public class NetworkChangeNotifierTest extends InstrumentationTestCase {
// Dummy implementations to avoid NullPointerExceptions in default implementations:
@Override
- public int getDefaultNetId() {
+ public long getDefaultNetId() {
return NetId.INVALID;
}
@@ -278,13 +278,13 @@ public class NetworkChangeNotifierTest extends InstrumentationTestCase {
// The type of change.
final ChangeType mChangeType;
// The network identifier of the network changing.
- final int mNetId;
+ final long mNetId;
/**
* @param changeType the type of change.
* @param netId the network identifier of the network changing.
*/
- ChangeInfo(ChangeType changeType, int netId) {
+ ChangeInfo(ChangeType changeType, long netId) {
mChangeType = changeType;
mNetId = netId;
}
@@ -303,25 +303,25 @@ public class NetworkChangeNotifierTest extends InstrumentationTestCase {
public void onMaxBandwidthChanged(double maxBandwidthMbps) {}
@Override
- public void onNetworkConnect(int netId, int connectionType) {
+ public void onNetworkConnect(long netId, int connectionType) {
ThreadUtils.assertOnUiThread();
mChanges.add(new ChangeInfo(ChangeType.CONNECT, netId));
}
@Override
- public void onNetworkSoonToDisconnect(int netId) {
+ public void onNetworkSoonToDisconnect(long netId) {
ThreadUtils.assertOnUiThread();
mChanges.add(new ChangeInfo(ChangeType.SOON_TO_DISCONNECT, netId));
}
@Override
- public void onNetworkDisconnect(int netId) {
+ public void onNetworkDisconnect(long netId) {
ThreadUtils.assertOnUiThread();
mChanges.add(new ChangeInfo(ChangeType.DISCONNECT, netId));
}
@Override
- public void purgeActiveNetworkList(int[] activeNetIds) {
+ public void purgeActiveNetworkList(long[] activeNetIds) {
ThreadUtils.assertOnUiThread();
if (activeNetIds.length == 1) {
mChanges.add(new ChangeInfo(ChangeType.PURGE_LIST, activeNetIds[0]));
@@ -766,7 +766,7 @@ public class NetworkChangeNotifierTest extends InstrumentationTestCase {
}
@Override
- int getDefaultNetId() {
+ long getDefaultNetId() {
return Integer.parseInt(mNetworks[1].toString());
}

Powered by Google App Engine
This is Rietveld 408576698