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

Side by Side Diff: tools/telemetry/telemetry/timeline_event_unittest.py

Issue 12278015: [Telemetry] Reorganize everything. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add shebangs. Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import unittest
6
7 from telemetry.timeline_event import TimelineEvent
8
9 class TimelineEventTest(unittest.TestCase):
10 def testChildrenLogic(self):
11 # [ top ]
12 # [ a ] [ b ]
13 # [x]
14 top = TimelineEvent('top', 0, 10)
15 a = TimelineEvent('a', 1, 2)
16 x = TimelineEvent('x', 1.5, 0.25)
17 b = TimelineEvent('b', 5, 2)
18 top.children.extend([a, b])
19 a.children.append(x)
20
21 all_children = top.GetAllChildrenRecursive(include_self=True)
22 self.assertEquals([top, a, x, b], all_children)
23
24 self.assertEquals(x.self_time_ms, 0.25)
25 self.assertEquals(a.self_time_ms, 1.75) # 2 - 0.25
26 self.assertEquals(top.self_time_ms, 6) # 10 - 2 -2
27
OLDNEW
« no previous file with comments | « tools/telemetry/telemetry/timeline_event.py ('k') | tools/telemetry/telemetry/timeline_model.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698