Index: tools/perf/metrics/timeline_unittest.py |
diff --git a/tools/perf/metrics/timeline_unittest.py b/tools/perf/metrics/timeline_unittest.py |
index 5ae1a5d66fdc65e9e141fee500ae54cde962b0d2..9a42aaed24b31c96ecc0c9894aabe3961e7454f8 100644 |
--- a/tools/perf/metrics/timeline_unittest.py |
+++ b/tools/perf/metrics/timeline_unittest.py |
@@ -109,14 +109,16 @@ class ThreadTimesTimelineMetricUnittest(unittest.TestCase): |
# Test that all result thread categories exist |
for name in timeline.TimelineThreadCategories.values(): |
- results.GetPageSpecificValueNamed(timeline.ThreadCpuTimeResultName(name)) |
+ results.GetPageSpecificValueNamed( |
+ timeline.ThreadCpuTimeResultName(name, 'frame')) |
def testBasic(self): |
model = model_module.TimelineModel() |
renderer_main = model.GetOrCreateProcess(1).GetOrCreateThread(2) |
renderer_main.name = 'CrRendererMain' |
- # Create two frame swaps (Results times should be divided by two) |
+ # Create two frame swaps (Results times should be divided by two) for |
+ # an interaction that lasts 20 milliseconds. |
cc_main = model.GetOrCreateProcess(1).GetOrCreateThread(3) |
cc_main.name = 'Compositor' |
cc_main.BeginSlice('cc_cat', timeline.FrameTraceName, 10, 10) |
@@ -144,12 +146,17 @@ class ThreadTimesTimelineMetricUnittest(unittest.TestCase): |
main_thread = "renderer_main" |
cc_thread = 'renderer_compositor' |
assert_results = [ |
- (timeline.ThreadCpuTimeResultName(main_thread), 'ms', 9.75), |
- (timeline.ThreadTasksResultName(main_thread), 'tasks', 0.5), |
+ (timeline.ThreadCpuTimeResultName(main_thread, 'frame'), 'ms', 9.75), |
+ (timeline.ThreadTasksResultName(main_thread, 'frame'), 'tasks', 0.5), |
(timeline.ThreadMeanFrameTimeResultName(cc_thread), 'ms', 10.0), |
- (timeline.ThreadDetailResultName(main_thread,'cat1'), 'ms', 9.5), |
- (timeline.ThreadDetailResultName(main_thread,'cat2'), 'ms', 0.5), |
- (timeline.ThreadDetailResultName(main_thread,'idle'), 'ms', 0) |
+ (timeline.ThreadCpuTimeResultName(main_thread, 'ms'), 'ms', 0.975), |
+ (timeline.ThreadTasksResultName(main_thread, 'ms'), 'tasks', 0.050), |
+ (timeline.ThreadCpuTimeResultName(cc_thread, 'ms'), 'ms', 0.1), |
+ (timeline.ThreadDetailResultName(main_thread, 'frame', 'cat1'), |
+ 'ms', 9.5), |
+ (timeline.ThreadDetailResultName(main_thread, 'frame', 'cat2'), |
+ 'ms', 0.5), |
+ (timeline.ThreadDetailResultName(main_thread, 'frame', 'idle'), 'ms', 0) |
nednguyen
2015/05/04 00:39:46
What about the detail results for per ms cases?
jdduke (slow)
2015/05/04 17:46:20
Done.
|
] |
nednguyen
2015/05/04 00:39:46
Also can you add assertion for mean_frame_times to
jdduke (slow)
2015/05/04 17:46:20
Hmm, we already check timeline.ThreadMeanFrameTime
|
for name, unit, value in assert_results: |
results.AssertHasPageSpecificScalarValue(name, unit, value) |
@@ -183,7 +190,7 @@ class ThreadTimesTimelineMetricUnittest(unittest.TestCase): |
# Test a couple specific results. |
assert_results = { |
- timeline.ThreadCpuTimeResultName('renderer_main') : 9.0, |
+ timeline.ThreadCpuTimeResultName('renderer_main', 'frame') : 9.0, |
} |
for name, value in assert_results.iteritems(): |
results.AssertHasPageSpecificScalarValue(name, 'ms', value) |