@@ -0,0 +1,1571 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.%0A# Use of this source code is governed by a BSD-style license that can be%0A# found in the LICENSE file.%0Afrom telemetry.core.backends.chrome import tracing_backend%0Afrom telemetry.core.timeline import model%0Afrom telemetry.page.actions import action_runner as action_runner_module%0Afrom telemetry.unittest import tab_test_case%0Afrom telemetry.web_perf import timeline_interaction_record as tir_module%0A%0A%0Aclass ActionRunnerTest(tab_test_case.TabTestCase):%0A  def testIssuingInteractionRecord(self):%0A    self.Navigate('blank.html')%0A    action_runner = action_runner_module.ActionRunner(None, self._tab)%0A    self._browser.StartTracing(tracing_backend.MINIMAL_TRACE_CATEGORIES)%0A    action_runner.BeginInteraction('TestInteraction', %5Btir_module.IS_SMOOTH%5D)%0A    action_runner.EndInteraction('TestInteraction', %5Btir_module.IS_SMOOTH%5D)%0A    trace_data = self._browser.StopTracing()%0A    timeline_model = model.TimelineModel(trace_data)%0A%0A    records = %5B%5D%0A    renderer_thread = timeline_model.GetRendererThreadFromTab(self._tab)%0A    for event in renderer_thread.async_slices:%0A      if not tir_module.IsTimelineInteractionRecord(event.name):%0A        continue%0A      records.append(tir_module.TimelineInteractionRecord.FromEvent(event))%0A    self.assertEqual(1, len(records),%0A                     'Fail to issue the interaction record on tracing timeline.'%0A                     ' Trace data:%5Cn%25s' %25 repr(trace_data.EventData()))%0A    self.assertEqual('TestInteraction', records%5B0%5D.logical_name)%0A    self.assertTrue(records%5B0%5D.is_smooth)%0A

Add test for action_runner.BeginInteraction and action_runner.EndInteraction.