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

Unified Diff: chrome/test/pyautolib/remote_inspector_client.py

Issue 11054014: Add a test for checking objects reported by DevTools memory instrumentation not allocated by tcmall… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated comments of new methods in class NativeMemorySnapshot Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/functional/devtools_test_base.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/pyautolib/remote_inspector_client.py
diff --git a/chrome/test/pyautolib/remote_inspector_client.py b/chrome/test/pyautolib/remote_inspector_client.py
index bda06c7ebef254b27e3e005115144c35ccc99e88..9e9fa011c3251f9a18f4e9e95a7ca0a2a6e76ed0 100755
--- a/chrome/test/pyautolib/remote_inspector_client.py
+++ b/chrome/test/pyautolib/remote_inspector_client.py
@@ -711,6 +711,11 @@ class NativeMemorySnapshot(object):
Public Methods:
GetProcessPrivateMemorySize: The process total size.
GetUnknownSize: Size of not instrumented parts.
+ GetInstrumentedObjectsCount: Number of instrumented objects traversed by
+ DevTools memory instrumentation.
+ GetNumberOfInstrumentedObjectsNotInHeap: Number of instrumented objects
+ visited by DevTools memory instrumentation that haven't been allocated
+ by tcmalloc.
FindMemoryBlock: Given an array of memory block names return the block.
"""
def __init__(self, root_block):
@@ -726,6 +731,31 @@ class NativeMemorySnapshot(object):
known_size += child['size']
return self.GetProcessPrivateMemorySize() - known_size
+ def GetInstrumentedObjectsCount(self):
+ """Returns number of objects visited by DevTools memory instrumentation.
+
+ Returns:
+ Number of known instrumented objects or None if it is not available.
+ """
+ memory_block = self.FindMemoryBlock(['ProcessPrivateMemory',
+ 'InstrumentedObjectsCount'])
+ if not memory_block is None:
+ return memory_block['size']
+ return None
+
+ def GetNumberOfInstrumentedObjectsNotInHeap(self):
+ """Returns number of instrumented objects unknown to tcmalloc.
+
+ Returns:
+ Number of known instrumented objects that are not allocated by tcmalloc,
+ None if it is not available.
+ """
+ memory_block = self.FindMemoryBlock(['ProcessPrivateMemory',
+ 'InstrumentedButNotAllocatedObjectsCount'])
+ if not memory_block is None:
+ return memory_block['size']
+ return None
+
def FindMemoryBlock(self, path):
"""Find memory block with given path.
« no previous file with comments | « chrome/test/functional/devtools_test_base.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698