overrideNetworkState method
Future<void>
overrideNetworkState(
- bool offline,
- num latency,
- num downloadThroughput,
- num uploadThroughput, {
- ConnectionType? connectionType,
Override the state of navigator.onLine and navigator.connection.
offline True to emulate internet disconnection.
latency Minimum latency from request sent to response headers received (ms).
downloadThroughput Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
uploadThroughput Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.
connectionType Connection type if known.
Implementation
Future<void> overrideNetworkState(
bool offline,
num latency,
num downloadThroughput,
num uploadThroughput, {
ConnectionType? connectionType,
}) async {
await _client.send('Network.overrideNetworkState', {
'offline': offline,
'latency': latency,
'downloadThroughput': downloadThroughput,
'uploadThroughput': uploadThroughput,
if (connectionType != null) 'connectionType': connectionType,
});
}