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

Side by Side Diff: perf_insights/perf_insights/mappers/thread_grouping_test.html

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2013 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
6 -->
7
8 <link rel="import" href="/perf_insights/mre/mre_result.html">
9 <link rel="import" href="/tracing/core/test_utils.html">
10 <link rel="import" href="/tracing/extras/chrome/chrome_test_utils.html">
11
12 <script>
13 'use strict';
14
15 tr.b.unittest.testSuite(function() {
16 var test_utils = tr.c.TestUtils;
17 test('basicChrome', function() {
18 var m = tr.e.chrome.ChromeTestUtils.newChromeModel(function(m) {
19 // Browser.
20 m.browserMain.sliceGroup.pushSlice(test_utils.newSliceEx({
21 name: 'BrowserSlice',
22 start: 0, duration: 10
23 }));
24
25 // Renderer.
26 m.rendererMain.sliceGroup.pushSlice(test_utils.newSliceEx({
27 name: 'RendererSlice',
28 start: 0, duration: 10
29 }));
30
31 // Something else else.
32 m.otherProcess = m.getOrCreateProcess(20);
33 m.otherProcessMain = m.otherProcess.getOrCreateThread(21);
34 m.otherProcessMain.sliceGroup.pushSlice(test_utils.newSliceEx({
35 name: 'RendererSlice',
36 start: 0, duration: 10
37 }));
38 });
39
40 var tg = new pi.m.ThreadGrouping();
41 tg.autoInitUsingHelpers(m);
42
43 var allSlices = new tr.model.EventSet();
44 m.iterateAllEvents(function(e) {
45 if (e instanceof tr.model.Slice)
46 allSlices.push(e);
47 });
48 var groups = tg.divideEventSetIntoSubGroups(allSlices);
49 var numGrouped = 0;
50 tr.b.iterItems(groups, function(groupName, eventSet) {
51 numGrouped += eventSet.length;
52 });
53 assert.equal(numGrouped, allSlices.length);
54 assert.equal(groups.Browser.length, 1);
55 assert.equal(groups.Renderer.length, 1);
56 assert.equal(groups.Other.length, 1);
57 });
58 });
59 </script>
OLDNEW
« no previous file with comments | « perf_insights/perf_insights/mappers/thread_grouping.html ('k') | perf_insights/perf_insights/mappers/trace_import_cost.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698