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

Unified Diff: tools/telemetry/telemetry/internal/actions/play.py

Issue 1647513002: Delete tools/telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/internal/actions/play.py
diff --git a/tools/telemetry/telemetry/internal/actions/play.py b/tools/telemetry/telemetry/internal/actions/play.py
deleted file mode 100644
index dfa0af2da8e0cb5115308224c4618d074ed664dd..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/internal/actions/play.py
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 2013 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.
-
-"""A Telemetry page_action that performs the "play" action on media elements.
-
-Media elements can be specified by a selector argument. If no selector is
-defined then then the action attempts to play the first video element or audio
-element on the page. A selector can also be 'all' to play all media elements.
-
-Other arguments to use are: playing_event_timeout_in_seconds and
-ended_event_timeout_in_seconds, which forces the action to wait until
-playing and ended events get fired respectively.
-"""
-
-from telemetry.core import exceptions
-from telemetry.internal.actions import media_action
-from telemetry.internal.actions import page_action
-
-
-class PlayAction(media_action.MediaAction):
- def __init__(self, selector=None,
- playing_event_timeout_in_seconds=0,
- ended_event_timeout_in_seconds=0):
- super(PlayAction, self).__init__()
- self._selector = selector if selector else ''
- self._playing_event_timeout_in_seconds = playing_event_timeout_in_seconds
- self._ended_event_timeout_in_seconds = ended_event_timeout_in_seconds
-
- def WillRunAction(self, tab):
- """Load the media metrics JS code prior to running the action."""
- super(PlayAction, self).WillRunAction(tab)
- self.LoadJS(tab, 'play.js')
-
- def RunAction(self, tab):
- try:
- tab.ExecuteJavaScript('window.__playMedia("%s");' % self._selector)
- # Check if we need to wait for 'playing' event to fire.
- if self._playing_event_timeout_in_seconds > 0:
- self.WaitForEvent(tab, self._selector, 'playing',
- self._playing_event_timeout_in_seconds)
- # Check if we need to wait for 'ended' event to fire.
- if self._ended_event_timeout_in_seconds > 0:
- self.WaitForEvent(tab, self._selector, 'ended',
- self._ended_event_timeout_in_seconds)
- except exceptions.EvaluateException:
- raise page_action.PageActionFailed('Cannot play media element(s) with '
- 'selector = %s.' % self._selector)
« no previous file with comments | « tools/telemetry/telemetry/internal/actions/play.js ('k') | tools/telemetry/telemetry/internal/actions/play_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698