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

Side by Side Diff: build/android/pylib/gtest/test_package_apk.py

Issue 1115173004: [Android] Rename ChromeNativeTest* to NativeTest*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: switch to org.chromium.base.Log Created 5 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
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """Defines TestPackageApk to help run APK-based native tests.""" 5 """Defines TestPackageApk to help run APK-based native tests."""
6 # pylint: disable=W0212 6 # pylint: disable=W0212
7 7
8 import logging 8 import logging
9 import os 9 import os
10 import shlex 10 import shlex
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 '%s-debug.apk' % suite_name) 44 '%s-debug.apk' % suite_name)
45 self._package_info = constants.PACKAGE_INFO['gtest'] 45 self._package_info = constants.PACKAGE_INFO['gtest']
46 46
47 def _CreateCommandLineFileOnDevice(self, device, options): 47 def _CreateCommandLineFileOnDevice(self, device, options):
48 device.WriteFile(self._package_info.cmdline_file, 48 device.WriteFile(self._package_info.cmdline_file,
49 self.suite_name + ' ' + options) 49 self.suite_name + ' ' + options)
50 50
51 def _GetFifo(self): 51 def _GetFifo(self):
52 # The test.fifo path is determined by: 52 # The test.fifo path is determined by:
53 # testing/android/native_test/java/src/org/chromium/native_test/ 53 # testing/android/native_test/java/src/org/chromium/native_test/
54 # ChromeNativeTestActivity.java and 54 # NativeTestActivity.java and
55 # testing/android/native_test_launcher.cc 55 # testing/android/native_test_launcher.cc
56 return '/data/data/' + self._package_info.package + '/files/test.fifo' 56 return '/data/data/' + self._package_info.package + '/files/test.fifo'
57 57
58 def _ClearFifo(self, device): 58 def _ClearFifo(self, device):
59 device.RunShellCommand('rm -f ' + self._GetFifo()) 59 device.RunShellCommand('rm -f ' + self._GetFifo())
60 60
61 def _WatchFifo(self, device, timeout, logfile=None): 61 def _WatchFifo(self, device, timeout, logfile=None):
62 for i in range(100): 62 for i in range(100):
63 if device.FileExists(self._GetFifo()): 63 if device.FileExists(self._GetFifo()):
64 logging.info('Fifo created. Slept for %f secs' % (i * 0.5)) 64 logging.info('Fifo created. Slept for %f secs' % (i * 0.5))
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 self._StartActivity(device, force_stop=False) 138 self._StartActivity(device, force_stop=False)
139 finally: 139 finally:
140 self.tool.CleanUpEnvironment() 140 self.tool.CleanUpEnvironment()
141 logfile = android_commands.NewLineNormalizer(sys.stdout) 141 logfile = android_commands.NewLineNormalizer(sys.stdout)
142 return self._WatchFifo(device, timeout=10, logfile=logfile) 142 return self._WatchFifo(device, timeout=10, logfile=logfile)
143 143
144 #override 144 #override
145 def Install(self, device): 145 def Install(self, device):
146 self.tool.CopyFiles(device) 146 self.tool.CopyFiles(device)
147 device.Install(self.suite_path) 147 device.Install(self.suite_path)
OLDNEW
« no previous file with comments | « build/android/pylib/gtest/local_device_gtest_run.py ('k') | build/android/pylib/remote/device/remote_device_gtest_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698