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

Side by Side Diff: trunk/src/tools/telemetry/telemetry/page/actions/action_runner_unittest.py

Issue 284183014: Revert 272549 "Add test for action_runner.BeginInteraction and a..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2014 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 from telemetry.core.backends.chrome import tracing_backend
5 from telemetry.core.timeline import model
6 from telemetry.page.actions import action_runner as action_runner_module
7 from telemetry.unittest import tab_test_case
8 from telemetry.web_perf import timeline_interaction_record as tir_module
9
10
11 class ActionRunnerTest(tab_test_case.TabTestCase):
12 def testIssuingInteractionRecord(self):
13 self.Navigate('blank.html')
14 action_runner = action_runner_module.ActionRunner(None, self._tab)
15 self._browser.StartTracing(tracing_backend.MINIMAL_TRACE_CATEGORIES)
16 action_runner.BeginInteraction('TestInteraction', [tir_module.IS_SMOOTH])
17 action_runner.EndInteraction('TestInteraction', [tir_module.IS_SMOOTH])
18 trace_data = self._browser.StopTracing()
19 timeline_model = model.TimelineModel(trace_data)
20
21 records = []
22 renderer_thread = timeline_model.GetRendererThreadFromTab(self._tab)
23 for event in renderer_thread.async_slices:
24 if not tir_module.IsTimelineInteractionRecord(event.name):
25 continue
26 records.append(tir_module.TimelineInteractionRecord.FromEvent(event))
27 self.assertEqual(1, len(records),
28 'Fail to issue the interaction record on tracing timeline.'
29 ' Trace data:\n%s' % repr(trace_data.EventData()))
30 self.assertEqual('TestInteraction', records[0].logical_name)
31 self.assertTrue(records[0].is_smooth)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698