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

Side by Side Diff: chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_page.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 unified diff | Download patch
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import os 5 import os
6 import time 6 import time
7 import utils
7 8
8 from telemetry import page 9 from telemetry import page
9 from telemetry import story 10 from telemetry import story
10 from telemetry.core import exceptions 11 from telemetry.core import exceptions
11 12
12 13
13 class CastPage(page.Page): 14 class CastPage(page.Page):
14 """Abstract Cast page for Media Router Telemetry tests.""" 15 """Abstract Cast page for Media Router Telemetry tests."""
15 16
16 def ChooseSink(self, tab, sink_name): 17 def ChooseSink(self, tab, sink_name):
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 53
53 start_time = time.time() 54 start_time = time.time()
54 while (not verify_func() and 55 while (not verify_func() and
55 time.time() - start_time < timeout): 56 time.time() - start_time < timeout):
56 action_runner.Wait(1) 57 action_runner.Wait(1)
57 if not verify_func(): 58 if not verify_func():
58 raise page.page_test.Failure(error_message) 59 raise page.page_test.Failure(error_message)
59 60
60 def _GetDeviceName(self): 61 def _GetDeviceName(self):
61 """Gets device name from environment variable RECEIVER_NAME.""" 62 """Gets device name from environment variable RECEIVER_NAME."""
62 if 'RECEIVER_NAME' not in os.environ or not os.environ.get('RECEIVER_NAME'): 63
64 if 'RECEIVER_IP' not in os.environ or not os.environ.get('RECEIVER_IP'):
63 raise page.page_test.Failure( 65 raise page.page_test.Failure(
64 'Your test machine is not set up correctly, ' 66 'Your test machine is not set up correctly, '
65 'RECEIVER_NAME enviroment variable is missing.') 67 'RECEIVER_IP enviroment variable is missing.')
66 return os.environ.get('RECEIVER_NAME') 68 return utils.GetDeviceName(os.environ.get('RECEIVER_IP'))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698