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

Unified Diff: tools/telemetry/telemetry/page/actions/action_runner_unittest.py

Issue 313383002: Cleanup interaction creation and add ExecuteJavaScript to action_runner.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
Index: tools/telemetry/telemetry/page/actions/action_runner_unittest.py
diff --git a/tools/telemetry/telemetry/page/actions/action_runner_unittest.py b/tools/telemetry/telemetry/page/actions/action_runner_unittest.py
index ab33a19893bdf887b77205340012ea51ab9642c2..827609701ee97297a60b4b78b56e91c7f00bd336 100644
--- a/tools/telemetry/telemetry/page/actions/action_runner_unittest.py
+++ b/tools/telemetry/telemetry/page/actions/action_runner_unittest.py
@@ -1,6 +1,7 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+
from telemetry.core.backends.chrome import tracing_backend
from telemetry.core.timeline import model
from telemetry.page.actions import action_runner as action_runner_module
@@ -16,8 +17,9 @@ class ActionRunnerTest(tab_test_case.TabTestCase):
self.Navigate('interaction_enabled_page.html')
action_runner.RunAction(WaitAction({'seconds': 1}))
self._browser.StartTracing(tracing_backend.DEFAULT_TRACE_CATEGORIES)
- action_runner.BeginInteraction('TestInteraction', [tir_module.IS_SMOOTH])
- action_runner.EndInteraction('TestInteraction', [tir_module.IS_SMOOTH])
+ interaction = action_runner.BeginInteraction(
+ 'TestInteraction', is_smooth=True)
+ interaction.End()
trace_data = self._browser.StopTracing()
timeline_model = model.TimelineModel(trace_data)
@@ -32,3 +34,9 @@ class ActionRunnerTest(tab_test_case.TabTestCase):
' Trace data:\n%s' % repr(trace_data.EventData()))
self.assertEqual('TestInteraction', records[0].logical_name)
self.assertTrue(records[0].is_smooth)
+
+ def testExecuteJavaScript(self):
+ action_runner = action_runner_module.ActionRunner(self._tab)
+ self.Navigate('blank.html')
+ action_runner.ExecuteJavaScript('var testing = 42;')
+ self.assertEqual(42, self._tab.EvaluateJavaScript('testing'))
« no previous file with comments | « tools/telemetry/telemetry/page/actions/action_runner.py ('k') | tools/telemetry/telemetry/page/actions/all_page_actions.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698