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

Unified Diff: tools/telemetry/telemetry/web_perf/timeline_interaction_record_unittest.py

Issue 386023004: Cleanup while reading code: Move GetJavaScriptMarker to be a free function instead of static functi… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix tests. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/web_perf/timeline_interaction_record.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/web_perf/timeline_interaction_record_unittest.py
diff --git a/tools/telemetry/telemetry/web_perf/timeline_interaction_record_unittest.py b/tools/telemetry/telemetry/web_perf/timeline_interaction_record_unittest.py
index 138594af7fa1c44e10c257d2ea84826b3f35d0cd..d7121eae8a8b2317ffc9a421171953b6e2d06365 100644
--- a/tools/telemetry/telemetry/web_perf/timeline_interaction_record_unittest.py
+++ b/tools/telemetry/telemetry/web_perf/timeline_interaction_record_unittest.py
@@ -38,35 +38,34 @@ class TimelineInteractionRecordTests(unittest.TestCase):
def testCreate(self):
r = self.CreateSimpleRecordWithName('Interaction.LogicalName')
- self.assertEquals('LogicalName', r.logical_name)
+ self.assertEquals('LogicalName', r.label)
self.assertEquals(False, r.is_smooth)
self.assertEquals(False, r.is_responsive)
r = self.CreateSimpleRecordWithName('Interaction.LogicalName/is_smooth')
- self.assertEquals('LogicalName', r.logical_name)
+ self.assertEquals('LogicalName', r.label)
self.assertEquals(True, r.is_smooth)
self.assertEquals(False, r.is_responsive)
r = self.CreateSimpleRecordWithName(
'Interaction.LogicalNameWith/Slash/is_smooth')
- self.assertEquals('LogicalNameWith/Slash', r.logical_name)
+ self.assertEquals('LogicalNameWith/Slash', r.label)
self.assertEquals(True, r.is_smooth)
self.assertEquals(False, r.is_responsive)
r = self.CreateSimpleRecordWithName(
'Interaction.LogicalNameWith/Slash/is_smooth,is_responsive')
- self.assertEquals('LogicalNameWith/Slash', r.logical_name)
+ self.assertEquals('LogicalNameWith/Slash', r.label)
self.assertEquals(True, r.is_smooth)
self.assertEquals(True, r.is_responsive)
def testGetJavaScriptMarker(self):
- smooth_marker = tir_module.TimelineInteractionRecord.GetJavaScriptMarker(
- 'LogicalName', [tir_module.IS_SMOOTH])
- self.assertEquals('Interaction.LogicalName/is_smooth', smooth_marker)
- slr_marker = tir_module.TimelineInteractionRecord.GetJavaScriptMarker(
- 'LogicalName', [tir_module.IS_SMOOTH, tir_module.IS_RESPONSIVE])
- self.assertEquals('Interaction.LogicalName/is_smooth,is_responsive',
- slr_marker)
+ smooth_marker = tir_module.GetJavaScriptMarker(
+ 'MyLabel', [tir_module.IS_SMOOTH])
+ self.assertEquals('Interaction.MyLabel/is_smooth', smooth_marker)
+ slr_marker = tir_module.GetJavaScriptMarker(
+ 'MyLabel', [tir_module.IS_SMOOTH, tir_module.IS_RESPONSIVE])
+ self.assertEquals('Interaction.MyLabel/is_smooth,is_responsive', slr_marker)
def testGetOverlappedThreadTimeForSliceInSameThread(self):
# Create a renderer thread.
@@ -113,7 +112,7 @@ class TimelineInteractionRecordTests(unittest.TestCase):
end_thread=renderer_main, thread_start=30, thread_duration=30)
record = tir_module.TimelineInteractionRecord.FromAsyncEvent(s)
expected_repr = (
- 'TimelineInteractionRecord(logical_name=\'Test\', '
+ 'TimelineInteractionRecord(label=\'Test\', '
'start=0.000000, end=200.000000, flags=is_smooth, '
'async_event=TimelineEvent(name=\'Interaction.Test/is_smooth\','
' start=0.000000, duration=200, thread_start=30, thread_duration=30))')
« no previous file with comments | « tools/telemetry/telemetry/web_perf/timeline_interaction_record.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698