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

Unified Diff: chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_perf_pages.py

Issue 1907073002: Update cpu and memory metric calculation and several small improvements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Jennifer's comment Created 4 years, 8 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: chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_perf_pages.py
diff --git a/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_perf_pages.py b/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_perf_pages.py
index c112f23708b99c9e8f69c20bce4a63e5f46c0e75..ec155e9ff70d5862485f3ed9c5b806a87553f6c2 100644
--- a/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_perf_pages.py
+++ b/chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_perf_pages.py
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import utils
+
from telemetry import page
from telemetry import story
from benchmarks.pagesets import media_router_page
@@ -31,21 +33,7 @@ class CastDialogPage(media_router_page.CastPage):
shared_page_state_class=shared_page_state_class)
def RunPageInteractions(self, action_runner):
- # Wait for 5s after Chrome is opened in order to get consistent results.
- action_runner.Wait(5)
- with action_runner.CreateInteraction('LaunchDialog'):
- action_runner.ExecuteJavaScript('collectPerfData();')
- self._WaitForResult(
- action_runner,
- lambda: action_runner.EvaluateJavaScript('initialized'),
- 'Failed to initialize')
-
- action_runner.TapElement(selector='#start_session_button')
- action_runner.Wait(5)
- for tab in action_runner.tab.browser.tabs:
- # Close media router dialog
- if tab.url == 'chrome://media-router/':
- self.CloseDialog(tab)
+ pass
class CastIdlePage(CastDialogPage):
@@ -58,8 +46,11 @@ class CastIdlePage(CastDialogPage):
shared_page_state_class=SharedState)
def RunPageInteractions(self, action_runner):
- super(CastIdlePage, self).RunPageInteractions(action_runner)
- action_runner.Wait(15)
+ # Wait for 5s after Chrome is opened in order to get consistent results.
+ action_runner.Wait(5)
+ with action_runner.CreateInteraction('Idle'):
+ action_runner.ExecuteJavaScript('collectPerfData();')
+ action_runner.Wait(300)
class CastFlingingPage(media_router_page.CastPage):
@@ -75,8 +66,6 @@ class CastFlingingPage(media_router_page.CastPage):
# Wait for 5s after Chrome is opened in order to get consistent results.
action_runner.Wait(5)
with action_runner.CreateInteraction('flinging'):
- action_runner.ExecuteJavaScript('collectPerfData();')
-
self._WaitForResult(
action_runner,
lambda: action_runner.EvaluateJavaScript('initialized'),
@@ -103,14 +92,16 @@ class CastFlingingPage(media_router_page.CastPage):
timeout=10)
# Load Media
- # TODO: use local video instead of the public one.
self.ExecuteAsyncJavaScript(
action_runner,
- 'loadMedia("http://easyhtml5video.com/images/happyfit2.mp4");',
+ 'loadMedia("%s");' % utils.GetInternalVideoURL(),
lambda: action_runner.EvaluateJavaScript('currentMedia'),
- 'Failed to load media')
+ 'Failed to load media',
+ timeout=120)
- action_runner.Wait(20)
+ action_runner.Wait(5)
+ action_runner.ExecuteJavaScript('collectPerfData();')
+ action_runner.Wait(300)
# Stop session
self.ExecuteAsyncJavaScript(
action_runner,

Powered by Google App Engine
This is Rietveld 408576698