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

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

Powered by Google App Engine
This is Rietveld 408576698