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

Unified Diff: chrome/browser/resources/tracing/timeline_analysis_test.html

Issue 10161025: Allow about:tracing Counters to be selected (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixen. Created 8 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
Index: chrome/browser/resources/tracing/timeline_analysis_test.html
diff --git a/chrome/browser/resources/tracing/timeline_analysis_test.html b/chrome/browser/resources/tracing/timeline_analysis_test.html
new file mode 100644
index 0000000000000000000000000000000000000000..2ce0fa377bbe38192011f3ae3a12b8dcadd8943a
--- /dev/null
+++ b/chrome/browser/resources/tracing/timeline_analysis_test.html
@@ -0,0 +1,114 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+Copyright (c) 2012 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.
+-->
+<head i18n-values="dir:textdirection;">
+<title>TimelineView tests</title>
+<link rel="stylesheet" href="overlay.css">
+<link rel="stylesheet" href="timeline.css">
+<link rel="stylesheet" href="timeline_analysis.css">
+<link rel="stylesheet" href="timeline_view.css">
+<link rel="stylesheet" href="../shared/css/tabs.css">
+<script src="http://closure-library.googlecode.com/svn/trunk/closure/goog/base.js"></script>
+<script src="../shared/js/cr.js"></script>
+<script src="../shared/js/cr/event_target.js"></script>
+<script src="../shared/js/cr/ui.js"></script>
+<script src="../shared/js/cr/ui/tabs.js"></script>
+<script src="overlay.js"></script>
+<script src="measuring_stick.js"></script>
+<script src="profiling_view.js"></script>
+<script src="timeline_analysis.js"></script>
+<script src="timeline_view.js"></script>
+<script src="timeline_model.js"></script>
+<script src="linux_perf_importer.js"></script>
+<script src="trace_event_importer.js"></script>
+<script src="timeline.js"></script>
+<script src="timeline_track.js"></script>
+<script src="sorted_array_utils.js"></script>
+<script src="fast_rect_renderer.js"></script>
+<script src="test_utils.js"></script>
+<script>
+ goog.require('goog.testing.jsunit');
+</script>
+<style>
+ .timeline-view {
+ border: 1px solid black;
+ margin: 10px;
+ }
+ .timeline-find-dialog {
+ border: 1px solid black;
+ margin: 10px;
+ }
+</style>
+</head>
+<body>
+ <script>
+ 'use strict';
+
+ function appendTestResult(title, el) {
+ var titleEl = document.createElement('div');
+ titleEl.textContent = title;
+ titleEl.style.fontSize = '120%';
+ titleEl.style.marginBottom = '0px';
+
+ var groupEl = document.createElement('div');
+ groupEl.style.marginBottom = '48px';
+ groupEl.style.border = '1px solid black';
+
+ groupEl.appendChild(el);
+ document.body.appendChild(titleEl);
+ document.body.appendChild(groupEl);
+ }
+
+ function testAnalyzeSingleSlice() {
+ var events = [
+ {name: 'b', args: {}, pid: 52, ts: 629, cat: 'foo', tid: 53, ph: 'B'},
+ {name: 'b', args: {}, pid: 52, ts: 631, cat: 'foo', tid: 53, ph: 'E'},
+ ];
+ var model = new tracing.TimelineModel();
+ model.importEvents(events);
+
+ var t53track = new tracing.TimelineThreadTrack();
+ t53track.thread = model.processes[52].threads[53];
+
+ var selection = new tracing.TimelineSelection();
+ t53track.addAllObjectsMatchingFilterToSelection(
+ new tracing.TimelineFilter('b'), selection);
+ assertEquals(1, selection.length);
+
+ var analysisEl = new tracing.TimelineAnalysisView();
+ analysisEl.selection = selection;
+
+ appendTestResult("Single thread slice", analysisEl);
+ }
+
+ function testAnalyzeMultipleNonNestedSlices() {
+ var events = [
+ {name: 'a', args: {}, pid: 52, ts: 520, cat: 'foo', tid: 53, ph: 'B'},
+ {name: 'a', args: {}, pid: 52, ts: 560, cat: 'foo', tid: 53, ph: 'E'},
+ {name: 'aa', args: {}, pid: 52, ts: 640, cat: 'foo', tid: 53, ph: 'B'},
+ {name: 'aa', args: {}, pid: 52, ts: 700, cat: 'foo', tid: 53, ph: 'E'},
+ ];
+ var model = new tracing.TimelineModel();
+ model.importEvents(events);
+
+ var t53track = new tracing.TimelineThreadTrack();
+ t53track.thread = model.processes[52].threads[53];
+
+ var selection = new tracing.TimelineSelection();
+ t53track.addAllObjectsMatchingFilterToSelection(
+ new tracing.TimelineFilter('a'), selection);
+ assertEquals(2, selection.length);
+
+ var analysisEl = new tracing.TimelineAnalysisView();
+ analysisEl.selection = selection;
+
+ appendTestResult("Multiple non nested thread slices", analysisEl);
+ }
+
+ </script>
+</body>
+</html>
« no previous file with comments | « chrome/browser/resources/tracing/timeline_analysis.js ('k') | chrome/browser/resources/tracing/timeline_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698