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

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: Test XHR with setting network emulation and refactored netowrk setter method Created 4 years, 6 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
samuong 2016/06/17 22:01:30 style nit: delete this blank line
roisinmcl 2016/06/20 18:14:16 Done.
415 params = {
416 'parameters': {
417 'type': connection_type
418 }
419 }
samuong 2016/06/17 22:01:30 style nit: you could fit these 5 lines on a single
roisinmcl 2016/06/20 18:14:16 Done.
420 self.ExecuteCommand(Command.SET_NETWORK_CONNECTION, params)
421
422 def testNetworkConditionsDifferentWebViews(self):
prasadv 2016/06/17 18:43:35 Is the function unittest for ExecuteCommand? Gener
samuong 2016/06/17 22:01:30 Yeah this shouldn't be here. Does anything even ca
roisinmcl 2016/06/20 18:14:16 It isn't called anywhere, I was unclear on the fun
423 self.ExecuteCommand(Command.GET_NETWORK_CONDITIONS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698