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

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

Issue 1004843002: [chromedriver] Add Network Presets to Network Throttling feature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaning up Network Names; adding integration tests 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 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 command_executor 5 import command_executor
6 from command_executor import Command 6 from command_executor import Command
7 from webelement import WebElement 7 from webelement import WebElement
8 8
9 9
10 class ChromeDriverException(Exception): 10 class ChromeDriverException(Exception):
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 params = { 365 params = {
366 'network_conditions': { 366 'network_conditions': {
367 'offline': False, 367 'offline': False,
368 'latency': latency, 368 'latency': latency,
369 'download_throughput': download_throughput, 369 'download_throughput': download_throughput,
370 'upload_throughput': upload_throughput 370 'upload_throughput': upload_throughput
371 } 371 }
372 } 372 }
373 self.ExecuteCommand(Command.SET_NETWORK_CONDITIONS, params) 373 self.ExecuteCommand(Command.SET_NETWORK_CONDITIONS, params)
374 374
375 def SetNetworkConditionsName(self, network_name):
376 self.ExecuteCommand(
377 Command.SET_NETWORK_CONDITIONS, {'network_name': network_name})
378
375 def GetNetworkConditions(self): 379 def GetNetworkConditions(self):
376 conditions = self.ExecuteCommand(Command.GET_NETWORK_CONDITIONS) 380 conditions = self.ExecuteCommand(Command.GET_NETWORK_CONDITIONS)
377 return { 381 return {
378 'latency': conditions['latency'], 382 'latency': conditions['latency'],
379 'download_throughput': conditions['download_throughput'], 383 'download_throughput': conditions['download_throughput'],
380 'upload_throughput': conditions['upload_throughput'], 384 'upload_throughput': conditions['upload_throughput'],
381 'offline': conditions['offline'] 385 'offline': conditions['offline']
382 } 386 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698