Class ChromiumNetworkConditions


  • public class ChromiumNetworkConditions
    extends java.lang.Object
    Provides manipulation of getting and setting network conditions from Chromium.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getDownloadThroughput()
      The current throughput of the network connection in kb/second for downloading.
      java.time.Duration getLatency()
      The current simulated latency of the connection.
      boolean getOffline()  
      int getUploadThroughput()
      The current throughput of the network connection in kb/second for uploading.
      void setDownloadThroughput​(int downloadThroughput)
      Sets the throughput of the network connection in kb/second for downloading.
      void setLatency​(java.time.Duration latency)
      Sets the simulated latency of the connection.
      void setOffline​(boolean offline)
      Whether the network is set to offline.
      void setUploadThroughput​(int uploadThroughput)
      Sets the throughput of the network connection in kb/second for uploading.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChromiumNetworkConditions

        public ChromiumNetworkConditions()
    • Method Detail

      • getOffline

        public boolean getOffline()
        Returns:
        whether network is simulated to be offline.
      • setOffline

        public void setOffline​(boolean offline)
        Whether the network is set to offline. Defaults to false.
        Parameters:
        offline - when set to true, network is simulated to be offline.
      • getLatency

        public java.time.Duration getLatency()
        The current simulated latency of the connection.
        Returns:
        amount of latency, typically a Duration of milliseconds.
      • setLatency

        public void setLatency​(java.time.Duration latency)
        Sets the simulated latency of the connection.
        Parameters:
        latency - amount of latency, typically a Duration of milliseconds.
      • getDownloadThroughput

        public int getDownloadThroughput()
        The current throughput of the network connection in kb/second for downloading.
        Returns:
        the current download throughput in kb/second.
      • setDownloadThroughput

        public void setDownloadThroughput​(int downloadThroughput)
        Sets the throughput of the network connection in kb/second for downloading.
        Parameters:
        downloadThroughput - throughput in kb/second
      • getUploadThroughput

        public int getUploadThroughput()
        The current throughput of the network connection in kb/second for uploading.
        Returns:
        the current upload throughput in kb/second.
      • setUploadThroughput

        public void setUploadThroughput​(int uploadThroughput)
        Sets the throughput of the network connection in kb/second for uploading.
        Parameters:
        uploadThroughput - throughput in kb/second