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

Unified Diff: tools/android/loading/sandwich_metrics_unittest.py

Issue 1925803003: sandwich: Make speed-index and memory measurement optional from run-all (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresses Egor's nit Created 4 years, 8 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 | « tools/android/loading/sandwich_metrics.py ('k') | tools/android/loading/sandwich_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/loading/sandwich_metrics_unittest.py
diff --git a/tools/android/loading/sandwich_metrics_unittest.py b/tools/android/loading/sandwich_metrics_unittest.py
index 73c8f3eb0b11c5c862509b7ae3f30ec44015ca20..e7553bc32ed11de166f4a476664abec1745045b7 100644
--- a/tools/android/loading/sandwich_metrics_unittest.py
+++ b/tools/android/loading/sandwich_metrics_unittest.py
@@ -19,7 +19,7 @@ import tracing
_BLINK_CAT = 'blink.user_timing'
-_MEM_CAT = 'disabled-by-default-memory-infra'
+_MEM_CAT = sandwich_runner.MEMORY_DUMP_CATEGORY
_START='requestStart'
_LOADS='loadEventStart'
_LOADE='loadEventEnd'
@@ -48,7 +48,7 @@ def TracingTrack(events):
return tracing.TracingTrack.FromJsonDict({
'events': events,
'categories': (tracing.INITIAL_CATEGORIES +
- sandwich_runner.ADDITIONAL_CATEGORIES)})
+ (sandwich_runner.MEMORY_DUMP_CATEGORY,))})
def LoadingTrace(events):
@@ -107,8 +107,6 @@ class PageTrackTest(unittest.TestCase):
{'pid': 354, 'ts': 11000, 'cat': 'whatever0', 'ph': 'R'},
{'pid': 672, 'ts': 12000, 'cat': _MEM_CAT, 'ph': 'v', 'name': NAME}]
- self.assertTrue(_MEM_CAT in sandwich_runner.ADDITIONAL_CATEGORIES)
-
bump_events = RunHelper(TRACE_EVENTS, 123)
self.assertEquals(2, len(bump_events))
self.assertEquals(5, bump_events[0].start_msec)
@@ -187,12 +185,17 @@ class PageTrackTest(unittest.TestCase):
self.assertEquals(17, trace_events['loadEventStart'].start_msec)
self.assertEquals(19, trace_events['loadEventEnd'].start_msec)
- def testPullMetricsFromLoadingTrace(self):
- metrics = puller._ExtractMetricsFromLoadingTrace(LoadingTrace(
+ def testExtractDefaultMetrics(self):
+ metrics = puller._ExtractDefaultMetrics(LoadingTrace(
_MINIMALIST_TRACE_EVENTS))
- self.assertEquals(4, len(metrics))
+ self.assertEquals(2, len(metrics))
self.assertEquals(20, metrics['total_load'])
self.assertEquals(5, metrics['js_onload_event'])
+
+ def testExtractMemoryMetrics(self):
+ metrics = puller._ExtractMemoryMetrics(LoadingTrace(
+ _MINIMALIST_TRACE_EVENTS))
+ self.assertEquals(2, len(metrics))
self.assertEquals(30971, metrics['browser_malloc_avg'])
self.assertEquals(55044, metrics['browser_malloc_max'])
« no previous file with comments | « tools/android/loading/sandwich_metrics.py ('k') | tools/android/loading/sandwich_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698