OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Chrome remote inspector utility for pyauto tests. | 6 """Chrome remote inspector utility for pyauto tests. |
7 | 7 |
8 This script provides a python interface that acts as a front-end for Chrome's | 8 This script provides a python interface that acts as a front-end for Chrome's |
9 remote inspector module, communicating via sockets to interact with Chrome in | 9 remote inspector module, communicating via sockets to interact with Chrome in |
10 the same way that the Developer Tools does. This -- in theory -- should allow | 10 the same way that the Developer Tools does. This -- in theory -- should allow |
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 """Retrieves memory object count information. | 1036 """Retrieves memory object count information. |
1037 | 1037 |
1038 Returns: | 1038 Returns: |
1039 A dictionary containing the memory object count information: | 1039 A dictionary containing the memory object count information: |
1040 { | 1040 { |
1041 'DOMNodeCount': integer, # Total number of DOM nodes. | 1041 'DOMNodeCount': integer, # Total number of DOM nodes. |
1042 'EventListenerCount': integer, # Total number of event listeners. | 1042 'EventListenerCount': integer, # Total number of event listeners. |
1043 } | 1043 } |
1044 """ | 1044 """ |
1045 # TODO(yurys): Remove this hack after M27 is released. | 1045 # TODO(yurys): Remove this hack after M27 is released. |
1046 if self._IsWebkitVersionNotOlderThan(537, 31): | 1046 if self._IsContentVersionNotOlderThan(537, 31): |
1047 return self._GetMemoryObjectCountsNew() | 1047 return self._GetMemoryObjectCountsNew() |
1048 | 1048 |
1049 MEMORY_COUNT_MESSAGES = [ | 1049 MEMORY_COUNT_MESSAGES = [ |
1050 ('Memory.getDOMNodeCount', {}) | 1050 ('Memory.getDOMNodeCount', {}) |
1051 ] | 1051 ] |
1052 | 1052 |
1053 self._event_listener_count = None | 1053 self._event_listener_count = None |
1054 self._dom_node_count = None | 1054 self._dom_node_count = None |
1055 | 1055 |
1056 done_condition = threading.Condition() | 1056 done_condition = threading.Condition() |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1396 False otherwise. | 1396 False otherwise. |
1397 | 1397 |
1398 Raises: | 1398 Raises: |
1399 RuntimeError: If remote Chromium version hasn't been fetched yet. | 1399 RuntimeError: If remote Chromium version hasn't been fetched yet. |
1400 """ | 1400 """ |
1401 if not hasattr(self, '_version'): | 1401 if not hasattr(self, '_version'): |
1402 raise RuntimeError('Browser revision has not been fetched yet.') | 1402 raise RuntimeError('Browser revision has not been fetched yet.') |
1403 version = self._version['browser'] | 1403 version = self._version['browser'] |
1404 | 1404 |
1405 return version['day'] > day_number | 1405 return version['day'] > day_number |
OLD | NEW |