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

Side by Side Diff: build/android/pylib/local/device/local_device_instrumentation_test_run.py

Issue 2891543002: [phone screen] Turn phone screen on for instrumentation tests
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 logging 5 import logging
6 import os 6 import os
7 import posixpath 7 import posixpath
8 import re 8 import re
9 import sys 9 import sys
10 import tempfile 10 import tempfile
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 device.GetExternalStoragePath(), 347 device.GetExternalStoragePath(),
348 'render_test_output_dir') 348 'render_test_output_dir')
349 flags_to_add.append('--render-test-output-dir=%s' % 349 flags_to_add.append('--render-test-output-dir=%s' %
350 render_tests_device_output_dir) 350 render_tests_device_output_dir)
351 351
352 if flags_to_add or flags_to_remove: 352 if flags_to_add or flags_to_remove:
353 self._CreateFlagChangerIfNeeded(device) 353 self._CreateFlagChangerIfNeeded(device)
354 self._flag_changers[str(device)].PushFlags( 354 self._flag_changers[str(device)].PushFlags(
355 add=flags_to_add, remove=flags_to_remove) 355 add=flags_to_add, remove=flags_to_remove)
356 356
357 if not device.IsScreenOn():
358 device.SetScreen(True)
359
357 try: 360 try:
358 device.RunShellCommand( 361 device.RunShellCommand(
359 ['log', '-p', 'i', '-t', _TAG, 'START %s' % test_name], 362 ['log', '-p', 'i', '-t', _TAG, 'START %s' % test_name],
360 check_return=True) 363 check_return=True)
361 time_ms = lambda: int(time.time() * 1e3) 364 time_ms = lambda: int(time.time() * 1e3)
362 start_ms = time_ms() 365 start_ms = time_ms()
363 366
364 stream_name = 'logcat_%s_%s_%s' % ( 367 stream_name = 'logcat_%s_%s_%s' % (
365 test_name.replace('#', '.'), 368 test_name.replace('#', '.'),
366 time.strftime('%Y%m%dT%H%M%S-UTC', time.gmtime()), 369 time.strftime('%Y%m%dT%H%M%S-UTC', time.gmtime()),
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 timeout *= cls._GetTimeoutScaleFromAnnotations(annotations) 630 timeout *= cls._GetTimeoutScaleFromAnnotations(annotations)
628 631
629 return timeout 632 return timeout
630 633
631 def _IsRenderTest(test): 634 def _IsRenderTest(test):
632 """Determines if a test or list of tests has a RenderTest amongst them.""" 635 """Determines if a test or list of tests has a RenderTest amongst them."""
633 if not isinstance(test, list): 636 if not isinstance(test, list):
634 test = [test] 637 test = [test]
635 return any([RENDER_TEST_FEATURE_ANNOTATION in t['annotations'].get( 638 return any([RENDER_TEST_FEATURE_ANNOTATION in t['annotations'].get(
636 FEATURE_ANNOTATION, {}).get('value', ()) for t in test]) 639 FEATURE_ANNOTATION, {}).get('value', ()) for t in test])
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698