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

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

Issue 11415205: [chromedriver] Implement connecting to devtools and loading a page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years 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 | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 ctypes 5 import ctypes
6 import json 6 import json
7 7
8 class ChromeDriverException(Exception): 8 class ChromeDriverException(Exception):
9 pass 9 pass
10 class UnknownCommand(ChromeDriverException): 10 class UnknownCommand(ChromeDriverException):
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 response_json = ctypes.string_at(response_data, response_size.value) 51 response_json = ctypes.string_at(response_data, response_size.value)
52 self._lib.Free(response_data) 52 self._lib.Free(response_data)
53 response = json.loads(response_json) 53 response = json.loads(response_json)
54 if response['status'] != 0: 54 if response['status'] != 0:
55 raise _ExceptionForResponse(response) 55 raise _ExceptionForResponse(response)
56 return response['value'] 56 return response['value']
57 57
58 def _ExecuteSessionCommand(self, name, params={}): 58 def _ExecuteSessionCommand(self, name, params={}):
59 return self._ExecuteCommand(name, params, self._session_id) 59 return self._ExecuteCommand(name, params, self._session_id)
60 60
61 def Load(self, url):
62 self._ExecuteSessionCommand('get', {'url': url})
63
61 def Quit(self): 64 def Quit(self):
62 """Quits the browser and ends the session.""" 65 """Quits the browser and ends the session."""
63 self._ExecuteSessionCommand('quit') 66 self._ExecuteSessionCommand('quit')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698