emulateNetworkConditions method

Future<void> emulateNetworkConditions(
  1. bool offline,
  2. num latency,
  3. num downloadThroughput,
  4. num uploadThroughput, {
  5. ConnectionType? connectionType,
})

Activates emulation of network conditions. 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> emulateNetworkConditions(
    bool offline, num latency, num downloadThroughput, num uploadThroughput,
    {ConnectionType? connectionType}) async {
  await _client.send('Network.emulateNetworkConditions', {
    'offline': offline,
    'latency': latency,
    'downloadThroughput': downloadThroughput,
    'uploadThroughput': uploadThroughput,
    if (connectionType != null) 'connectionType': connectionType,
  });
}