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

Unified Diff: tools/telemetry/telemetry/timeline/trace_event_importer_unittest.py

Issue 1553183002: [telemetry] Add support for composable process dumps in memory-infra (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes. Created 4 years, 11 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
Index: tools/telemetry/telemetry/timeline/trace_event_importer_unittest.py
diff --git a/tools/telemetry/telemetry/timeline/trace_event_importer_unittest.py b/tools/telemetry/telemetry/timeline/trace_event_importer_unittest.py
index f69960b9c6b90533d3d87c5995f1087acda50101..c3fde1590e7388d0ed7cba6ce81c844e340c1599 100644
--- a/tools/telemetry/telemetry/timeline/trace_event_importer_unittest.py
+++ b/tools/telemetry/telemetry/timeline/trace_event_importer_unittest.py
@@ -1059,18 +1059,27 @@ class TraceEventTimelineImporterTest(unittest.TestCase):
'id': '1234ABCD'},
{'name': 'a', 'cat': 'b', 'ph': 'v', 'pid': 54, 'ts': 134,
'id': '1234ABCD'},
+ {'name': 'a', 'cat': 'b', 'ph': 'v', 'pid': 52, 'ts': 144,
+ 'id': '1234ABCD'},
{'name': 'a', 'cat': 'b', 'ph': 'v', 'pid': 52, 'ts': 245,
'id': '1234ABDF'},
{'name': 'a', 'cat': 'b', 'ph': 'v', 'pid': 54, 'ts': 256,
'id': '1234ABDF'},
+ {'name': 'a', 'cat': 'b', 'ph': 'v', 'pid': 52, 'ts': 233,
+ 'id': '1234ABDF'},
]
- expected = [['1234ABCD', 0, 11], ['1234ABDF', 122, 11]]
+ expected_processes = set([52, 54])
+ expected_results = [['1234ABCD', 0, 21], ['1234ABDF', 110, 23]]
trace_data = trace_data_module.TraceData(events)
m = timeline_model.TimelineModel(trace_data)
+ assert set(p.pid for p in m.GetAllProcesses()) == expected_processes
+
memory_dumps = list(m.IterGlobalMemoryDumps())
- self.assertEqual(len(expected), len(memory_dumps))
- for memory_dump, test_values in zip(memory_dumps, expected):
+ self.assertEqual(len(expected_results), len(memory_dumps))
+ for memory_dump, test_values in zip(memory_dumps, expected_results):
+ assert len(list(memory_dump.IterProcessMemoryDumps())) == len(
+ expected_processes)
dump_id, start, duration = test_values
self.assertEquals(dump_id, memory_dump.dump_id)
self.assertAlmostEqual(start / 1000.0, memory_dump.start)

Powered by Google App Engine
This is Rietveld 408576698