OLD | NEW |
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 import json | 4 import json |
5 import logging | 5 import logging |
6 | 6 |
7 from telemetry import util | 7 from telemetry import util |
8 | 8 |
9 class InspectorPage(object): | 9 class InspectorPage(object): |
10 def __init__(self, inspector_backend): | 10 def __init__(self, inspector_backend): |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 """Returns the value of the cookie by the given |name|.""" | 86 """Returns the value of the cookie by the given |name|.""" |
87 request = { | 87 request = { |
88 'method': 'Page.getCookies' | 88 'method': 'Page.getCookies' |
89 } | 89 } |
90 res = self._inspector_backend.SyncRequest(request, timeout) | 90 res = self._inspector_backend.SyncRequest(request, timeout) |
91 cookies = res['result']['cookies'] | 91 cookies = res['result']['cookies'] |
92 for cookie in cookies: | 92 for cookie in cookies: |
93 if cookie['name'] == name: | 93 if cookie['name'] == name: |
94 return cookie['value'] | 94 return cookie['value'] |
95 return None | 95 return None |
OLD | NEW |