Skip to content

Commit

Permalink
JariBakken: Document the HTML5 Web Storage calls in the wire protocol.
Browse files Browse the repository at this point in the history
We should make a habit of always adding new commands to the wire
protocol first. This particular set of commands is now incorrectly
implemented in chromedriver (http://codereview.chromium.org/9149013).

r15750
  • Loading branch information
jarib committed Jan 30, 2012
1 parent 02bacfc commit e45677a
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions wire.py
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,48 @@ def main():
Post('Set the current geo location.').
AddJsonParameter('location', '{latitude: number, longitude: number, altitude: number}', 'The new location.'))

resources.append(
SessionResource('/session/:sessionId/local_storage').
Get('Get all keys of the storage.').
SetReturnType('{Array.<string>}', 'The list of keys.').
Post('Set the storage item for the given key.').
AddJsonParameter('key', '{string}', 'The key to set.').
AddJsonParameter('value', '{string}', 'The value to set.').
Delete('Clear the storage.'))

resources.append(
SessionResource('/session/:sessionId/local_storage/key/:key').
Get('Get the storage item for the given key.').
AddUrlParameter(':key', 'The key to get.').
Delete('Remove the storage item for the given key.').
AddUrlParameter(':key', 'The key to remove.'))

resources.append(
SessionResource('/session/:sessionId/local_storage/size').
Get('Get the number of items in the storage.').
SetReturnType('{number}', 'The number of items in the storage.'))

resources.append(
SessionResource('/session/:sessionId/session_storage').
Get('Get all keys of the storage.').
SetReturnType('{Array.<string>}', 'The list of keys.').
Post('Set the storage item for the given key.').
AddJsonParameter('key', '{string}', 'The key to set.').
AddJsonParameter('value', '{string}', 'The value to set.').
Delete('Clear the storage.'))

resources.append(
SessionResource('/session/:sessionId/session_storage/key/:key').
Get('Get the storage item for the given key.').
AddUrlParameter(':key', 'The key to get.').
Delete('Remove the storage item for the given key.').
AddUrlParameter(':key', 'The key to remove.'))

resources.append(
SessionResource('/session/:sessionId/session_storage/size').
Get('Get the number of items in the storage.').
SetReturnType('{number}', 'The number of items in the storage.'))

logging.info('Generating %s', wiki_path)
f = open(wiki_path, 'w')
try:
Expand Down

0 comments on commit e45677a

Please sign in to comment.