Index: chrome/test/chromedriver/client/chromedriver.py |
diff --git a/chrome/test/chromedriver/client/chromedriver.py b/chrome/test/chromedriver/client/chromedriver.py |
index a4389f97321ef041b6c24de531648b7df05021d7..fac0b220eaa9a5ada3169c630eb8acbbcd619775 100644 |
--- a/chrome/test/chromedriver/client/chromedriver.py |
+++ b/chrome/test/chromedriver/client/chromedriver.py |
@@ -357,3 +357,26 @@ class ChromeDriver(object): |
def SetAutoReporting(self, enabled): |
self.ExecuteCommand(Command.SET_AUTO_REPORTING, {'enabled': enabled}) |
+ |
+ def SetNetworkConditions(self, latency, download_throughput, |
+ upload_throughput): |
+ # Until crbug XXXXX is resolved, we must always set 'offline' to False, |
samuong
2015/02/11 23:22:14
Now that you've got an actual bug for this, the XX
srawlins
2015/02/25 22:40:57
Done.
|
+ # as going "offline" will sever Chromedriver's connection to Chrome. |
+ params = { |
+ 'network_conditions': { |
+ 'offline': False, |
+ 'latency': latency, |
+ 'download_throughput': download_throughput, |
+ 'upload_throughput': upload_throughput |
+ } |
+ } |
+ self.ExecuteCommand(Command.SET_NETWORK_CONDITIONS, params) |
+ |
+ def GetNetworkConditions(self): |
+ conditions = self.ExecuteCommand(Command.GET_NETWORK_CONDITIONS) |
+ return { |
+ 'latency': conditions['latency'], |
+ 'download_throughput': conditions['download_throughput'], |
+ 'upload_throughput': conditions['upload_throughput'], |
+ 'offline': conditions['offline'] |
+ } |