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

Unified Diff: chrome/test/chromedriver/client/chromedriver.py

Issue 883083002: [chromedriver] Add Network Conditions Override Manager and tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix warning Created 5 years, 9 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: chrome/test/chromedriver/client/chromedriver.py
diff --git a/chrome/test/chromedriver/client/chromedriver.py b/chrome/test/chromedriver/client/chromedriver.py
index a4389f97321ef041b6c24de531648b7df05021d7..3700a73a06339f2d42f8505c0cd9cc5ea85bc455 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 http://crbug.com/456324 is resolved, we'll always set 'offline' to
+ # False, 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']
+ }
« no previous file with comments | « chrome/test/chromedriver/chrome/web_view_impl.cc ('k') | chrome/test/chromedriver/client/command_executor.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698