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

Unified Diff: perf_insights/perf_insights_examples/map_startup_info_test.html

Issue 1290323003: Create a mapper to compute browser and renderer startup durations. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Answered nits. Created 5 years, 4 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: perf_insights/perf_insights_examples/map_startup_info_test.html
diff --git a/perf_insights/perf_insights_examples/map_startup_info_test.html b/perf_insights/perf_insights_examples/map_startup_info_test.html
new file mode 100644
index 0000000000000000000000000000000000000000..20715d9c4d2a5dba80f1ec7b2ee0c99d15465b1e
--- /dev/null
+++ b/perf_insights/perf_insights_examples/map_startup_info_test.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2013 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+-->
+
+<link rel="import" href="/perf_insights/value/value.html">
+<link rel="import" href="/perf_insights/value/run_info.html">
+<link rel="import" href="/perf_insights/results/results.html">
+<link rel="import" href="/perf_insights_examples/map_startup_info.html">
+<link rel="import" href="/tracing/core/test_utils.html">
+<link rel="import" href="/tracing/extras/rail/load_interaction_record.html">
+<link rel="import" href="/tracing/model/thread_slice.html">
+
+<script>
+'use strict';
+
+tr.b.unittest.testSuite(function() {
+ var test_utils = tr.c.test_utils;
+
+ test('mapperTest', function() {
+ var m = test_utils.newModel(function(m) {
+ var p1 = m.getOrCreateProcess(1);
+ var t2 = p1.getOrCreateThread(2);
+ t2.name = 'CrBrowserMain';
+ var t2_s1 = test_utils.newSliceEx({
+ name: 'Some slice',
+ start: 10, duration: 20,
+ type: tr.model.ThreadSlice
+ });
+ t2_s1.parentContainer = t2;
+ var t2_s2 = test_utils.newSliceEx({
+ name: 'Another slice',
+ start: 30, duration: 50,
+ type: tr.model.ThreadSlice
+ });
+ t2_s2.parentContainer = t2;
+ t2.sliceGroup.pushSlice(t2_s1);
+ t2.sliceGroup.pushSlice(t2_s2);
+ var loadIr = new tr.e.rail.LoadInteractionRecord(15, 45);
+ loadIr.name = 'Startup';
+ m.interaction_records.push(loadIr);
+ loadIr.associatedEvents.push(t2_s1);
+ loadIr.associatedEvents.push(t2_s2);
+ });
+
+ var results = new pi.r.Results();
+ var run_info = new pi.v.RunInfo('my_test.json');
+ pie.mapStartupInfo(results, run_info, m);
+
+ assert.equal(results.all_values.length, 1);
+ assert.equal(results.all_values[0].value.browserStartup.min, 10);
+ assert.equal(results.all_values[0].value.browserStartup.max, 80);
+ assert.isFalse(results.all_values[0].value.browserStartup.isEmpty);
+ assert.isTrue(results.all_values[0].value.rendererStartup.isEmpty);
+ });
+
+ test('mapperTestEmptyTrace', function() {
+ var m = test_utils.newModel();
+
+ var results = new pi.r.Results();
+ var run_info = new pi.v.RunInfo('my_test.json');
+ pie.mapStartupInfo(results, run_info, m);
+
+ assert.equal(results.all_values.length, 1);
+ assert.isTrue(results.all_values[0] instanceof pi.v.SkipValue);
+ });
+
+});
+
+</script>
« no previous file with comments | « perf_insights/perf_insights_examples/map_startup_info.html ('k') | tracing/tracing/extras/chrome/chrome_browser_helper.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698