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

Side by Side Diff: chrome/test/chromedriver/client/chromedriver.py

Issue 2065733002: Add a method to override the network conditions of the ChromeDriver session. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved fuction to top of setNetworkConnection Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import sys 5 import sys
6 import platform 6 import platform
7 7
8 import command_executor 8 import command_executor
9 from command_executor import Command 9 from command_executor import Command
10 from webelement import WebElement 10 from webelement import WebElement
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 conditions = self.ExecuteCommand(Command.GET_NETWORK_CONDITIONS) 402 conditions = self.ExecuteCommand(Command.GET_NETWORK_CONDITIONS)
403 return { 403 return {
404 'latency': conditions['latency'], 404 'latency': conditions['latency'],
405 'download_throughput': conditions['download_throughput'], 405 'download_throughput': conditions['download_throughput'],
406 'upload_throughput': conditions['upload_throughput'], 406 'upload_throughput': conditions['upload_throughput'],
407 'offline': conditions['offline'] 407 'offline': conditions['offline']
408 } 408 }
409 409
410 def DeleteNetworkConditions(self): 410 def DeleteNetworkConditions(self):
411 self.ExecuteCommand(Command.DELETE_NETWORK_CONDITIONS) 411 self.ExecuteCommand(Command.DELETE_NETWORK_CONDITIONS)
412
413 def SetNetworkConnection(self, connection_type):
414 params = {'parameters': {'type': connection_type}}
415 self.ExecuteCommand(Command.SET_NETWORK_CONNECTION, params)
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/chrome/chrome_desktop_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