1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 10:51:13 +01:00
Commit Graph

186 Commits

Author SHA1 Message Date
Marc Bonnici
81bdc7251b AndroidDevice: Pylint Fix 2017-05-30 12:06:36 +01:00
Marc Bonnici
bc6af25366 AndroidResource: Add a UiautoApk resource type.
When moving to Uiautomation 2, tests are now complied into apk files rather than
jar files. To avoid conflicts with regular workload apks a new resource type is
added to retrieve the test files which will be renamed to have the extension
.uiautoapk
2017-05-23 11:15:55 +01:00
Marc Bonnici
5d8305cfdc Android Device: Add force flag to install_apk
A force flag has been added to the `install_apk` method which
ignores the check that the specified file is an apk. This is to support
the new UiAutomation Apk which have been given the extention .uiautoapk.
2017-05-17 13:47:39 +01:00
Marc Bonnici
51c92cb2f5 Workloads: Updated to use new media refresh method
Updated the base android workload and google photos workload to pass a list of
updated files rather than their directory.
2017-05-11 18:17:38 +01:00
Marc Bonnici
e98b653b3e AndroidDevice: Add refresh_device_files method
Adds a method to determine the appropriate method of triggering a media refresh
of a given list of file based on the devices android version and root status. If
a device is running android marshmallow and below or has root, trigger a refresh
of the files containing folder otherwise trigger a refresh of each individual
file.
2017-05-11 18:17:38 +01:00
Marc Bonnici
b10b5970c3 AndroidDevice: Add a broadcast_media_scan_file method
In android N it is no longer allowed to trigger a media refresh of a directory
without root, therefore this method has been added to trigger a refresh of an
individual file.
2017-05-11 09:44:49 +01:00
Marc Bonnici
e866cfed12 AndroidDevice: Add as_root flag to broadcast_media_mounted
Allows the `MEDIA_MOUNTED` broadcast to be performed as root as
this now requires elevated permission in android N.
2017-05-11 09:11:24 +01:00
Sergei Trofimov
cc3a815cb7 uxperf workloads: only broadcast media mounted if needed
Previously AndroidPerfWorkload broadcast media mounted unconditionally
inside push_assets and delete_assets. This change makes it so the
broadcast only happens if something was actually pushed/needs to be
delete.
2017-05-10 15:42:10 +01:00
Marc Bonnici
50236b0661 Device: Updated to set and retrieve binary data from sysfiles
`set_sysfile_values` now accepts a `^` symbol prefixed to the
file path to indicated that the value should be written as binary data.
To accommodate this an extra `binary` flag has been added to  the `set_sysfile_value`and `get_sysfile_value` methods to write and retrieve the binary data respectively.
2017-04-06 15:59:01 +01:00
Michael McGeagh
c4025cad66 Changed ActionLogger class to use nano timestamps. This is because fps instrument collects data in ns as well so is possible to match the two 2017-02-24 16:11:35 +00:00
Marc Bonnici
6ffed382cf UxPerfUiAutomation: Added setWorkloadParameters and getPackageID.
To work around appshare requiring access to protected variables of a workload,
a `setWorkloadParameters` method has been added to manually supply a parameter
bundle, and a `getPackageID` method to retrieve a workloads package ID.
2017-02-22 16:21:10 +00:00
Marc Bonnici
d10e51e30b UiAutomator: Updated to decode provided parameters from ParameterDict
To prevent parameters having to be converted individually for each worload
the getParams() function has been overridden to perform the required type and
url decoding on the passed parameter bundle before passing the correctly typed
bundle to the workloads.
2017-02-20 16:44:24 +00:00
Marc Bonnici
bd0a6ac3c8 UiAutomatorWorkload: Changed to use a ParameterDict
Due to the limitations of UiAutomator, parameters are not allowed to contain
certain characters including spaces and newlines when passed on the command line.

The python UiAutomatorWorkload baseclasse has been updated to use a
ParameterDict when storing workload parameters.
2017-02-20 16:44:24 +00:00
Marc Bonnici
8c9ae6db53 AndroidWorkload: Split up setup_workload_apk method.
Split up `setup_workload_apk` method into smaller methods to improve readability.
2017-02-20 16:44:24 +00:00
Marc Bonnici
2bd77f0833 UiAutomator: Removed unnecessary class files.
Removed stale classes from the repository.
2017-02-03 17:14:33 +00:00
jummp01
0f57dee6bf Add ApplaunchInterface class
Inorder to support application launch workload, a new interface is created
which has methods that need to be implemented by all workloads that
support application launch time instrumentation.
2017-02-03 15:14:03 +00:00
jummp01
99b46b4630 Add UiAutoUtils class
UiAutoUtility class added to support utility functions used for UiAutomation.
This class can help in refactoring some existing fucntionalities into utility functions.

Launch command generation is added as a utility class method which can be used
by workloads to construct their launch command from parameters passed.
2017-02-03 15:13:50 +00:00
jummp01
4ce20e2d3f Move package parameters to UxperfUiAutomation
All the uxperf workloads get some common package parameters.
These are moved to the parent class and a new method is introduced to fill
these parameter values. All the uxperf workloads can call this method to resolve
the package parameters.
2017-02-03 15:13:32 +00:00
jummp01
65aa00483b Add pressHome() method in the Base class
This function Presses Home button on the Android User Interface.
2017-02-03 15:12:35 +00:00
setrofim
da7a3276ed Merge pull request #339 from marcbonnici/revent_fix
Revent fix / improvments
2017-02-01 18:10:32 +00:00
Marc Bonnici
54bffb45ab Revent: Fixed uninitialized variable. 2017-02-01 18:04:05 +00:00
Marc Bonnici
e7a47f602d Revent: Removed check for 'wait_for_stdin'.
Revent is terminated from WA via a 'SIGINT', therefore this means
that in order for revent to receive the signal and deal with it
accordingly, revent always needs to be listening on STDIN regardless of
the 'wait_for_stdin' flag.
2017-02-01 18:03:28 +00:00
Sergei Trofimov
490dd404ae AndroidDevice: write "dumpsys window" output on host
On Android targets, WA collects device display information by running
"dumpsys window" during run initialisation. Previously, this was
redirectied into on-device file (under the working directory) and then
pulled from the target.

It looks like on Android-on-ChromeOS devices the redirect leads to an
"Unknown Error" and the resulting file is empty. To get around that,
this commit modfies the dumpsys command so that the output is collected
directly from the shell's stdout and then writen on the host.
2017-01-24 17:52:51 +00:00
setrofim
fbb9908298 Merge pull request #330 from jimboatarm/break_setup
Splits ApkWorkload setup() into short methods.
2017-01-13 15:39:11 +00:00
jummp01
01fa0a3571 Splits ApkWorkload setup() into short methods.
Apkworkload setup phase performs many functionalities in
a single method that is broken down into short methods.
The split short methods can be called individually when
relevant use cases arise.
2017-01-13 11:56:39 +00:00
jummp01
fa553ee430 Changes Action Logger to give epoch time
Log time changed to produce epoch time in milli seconds.
Nano to milli second conversion done in uxperf result
processor is removed.

Tested on Mate8 and time obtained is verified.
2017-01-12 10:30:07 +00:00
James Hartley
b4026ae390 Fix inverted swipe up/down gestures
Tested on Chromebook and Mate 8
2016-12-15 15:28:23 +00:00
setrofim
d493b1e790 Merge pull request #307 from marcbonnici/exact_abi
Modified how apks containing native code are matched to a target devices supported abi(s).
2016-12-14 10:32:56 +00:00
Marc Bonnici
694d51ffb6 AndroidWorkload: Fixed validate version error messages.
Fixed typos in ``validate_version`` method which caused incorrect reporting
of maximum apk version.
2016-12-12 18:09:40 +00:00
Marc Bonnici
1477a89ee4 AndroidDevice: Renamed 'supported_eabis' property to 'supported_abis'
Renamed android device property from 'supported_eabis' to 'supported_abis' to be consistent with linux device.

Updated dex2oat workload to use new property name.
2016-12-09 15:23:58 +00:00
Marc Bonnici
0dfbbae7b6 Renamed 'check_abi' parameter to 'exact_abi' 2016-12-09 14:11:16 +00:00
Marc Bonnici
a8a8d21de6 AndroidWorkload: Modified workload to properly check for an apks abi
Previously when retrieving apks only it's name would be used to choose
an apk. Now the native code reported by the apk is used to determine
the correct version to run for the specific device. It tries to
match the primary abi of device with native code before falling back to
using a compatible apk.

When using the check_abi parameter it no longer relies on naming convention
and only allows apks with native code supporting a devices primary abi to be
used.

Updated the relevant documentation.
2016-12-09 14:11:16 +00:00
Marc Bonnici
f467f6f991 AndroidDevice: Added method to retrive primary abi of installed package
Tries to retireve the primary abi of a currently installed package on
device.
2016-12-09 14:11:16 +00:00
Marc Bonnici
eb239c65d0 LinuxDevice: Added supported eabi property.
Added property to linux device to return list of supported abis
to be consistent with android devices. Currently only returns a
list containing the primary abi.
2016-12-09 14:11:16 +00:00
setrofim
607187ad5b Merge pull request #306 from marcbonnici/revent_BC
Revent: Fixed backwards compatibility with v1
2016-12-02 17:02:06 +00:00
Marc Bonnici
b6e077c06b Revent: Fixed backwards compatibility with v1.
Fixed new gamemode not being set for compatibility mode.
Fixed input buffer not being flushed causing replay to fail.
Fixed infinte loop if revent recording did not end correctly.
Updated revent binaries.
2016-12-02 16:58:09 +00:00
setrofim
751970f991 Merge pull request #302 from marcbonnici/master
Revent: Added updated revent binaries.
2016-12-02 10:31:03 +00:00
Marc Bonnici
254e9fff38 Revent: Added updated revent binaries.
Added updated revent binaries for armabi and arm64 for the fixes
in commit 7a19046645
2016-12-02 09:55:19 +00:00
Michael McGeagh
cb53fe9ec8 Gmail: A workload to perform standard productivity tasks within Gmail. The workload carries out various tasks, such as creating new emails, attaching images and sending them.
Moved broadcast to super. Mandatory and Default are XOR

Added a longer wait for sync to finish. Increases reliability on certain phones

Changed recipient to not mandatory and a default set

Wait for sync when launching gmail from the sharing feature

Fix: cornercase where image viewer already points to working directory. Refactored code due to duplication

Added new function to BaseUiAutomation class to find a folder in the gallery
2016-12-01 13:21:49 +00:00
James Hartley
5b543d2edf Fix exact_apk_version check 2016-11-24 12:47:57 +00:00
James Hartley
ba34b973ac ApkWorkload: add check for an exact APK version
Checks for an APK version on the host or target which matches a specified value
2016-11-10 18:46:31 +00:00
Sergei Trofimov
edfef444fb revent: Updated WA to use the new revent
- Updated the revent parser to handle the new revent format.
- Updated the revent parser to expose device info and recording
  metatdata.
- The parser can now be used in streaming and non-streaming mode (stream
  events from the file as they are being accessed, or read them all in
  at once).
- -g option added to "record" command to expose the gamepad recording
  mode.
2016-10-26 13:33:54 +01:00
Sergei Trofimov
3a7a5276e4 revent: added gamepad recording + major refactor
- Added support for gamepad recording. This type of recording contains
  only the events from a gamepad device (which is automatically
  identified). The details of this devices are collected and stored as
  part of the recording. On playback, uinput is used to create a virtual
  gamepad and replay into it.
- A "mode" field has been added to the recording format to help
  distinguish between the normal and gamepad recording types.
- A field for the total number of input events has been added before the
  start of the event stream (after the device description).
- The structure of revent code has undergone a major overhaul to improve
  maintainability and robustness.
- More detailed "info" command output.
- Updated Makefile to support debug/production builds.
2016-10-26 13:17:07 +01:00
Marc Bonnici
9fffa7958a ReventWorkload: State detection fixes
- Corrected code highlighting and phase names in documentation
- Fixed check_states paremeter not being honoured
- Moved state dependencies check to happen earlier in execution
  and to be a user facing error
2016-10-26 11:16:49 +01:00
Sergei Trofimov
558e40698b AndroidDevice: fixing UI hierarchy capture
- renamed the capture method from "capture_view_hierachy" to
  "capture_ui_hierarchy" to fix typo and make more descriptive.
- Change the file extension of the cature file to ".uix" because this is
  the extension uiautomatorviewer looks for.
2016-10-17 13:49:19 +01:00
Sergei Trofimov
41b52178bb pylint fixes. 2016-10-17 11:02:41 +01:00
Sergei Trofimov
8aa1bdc63d AndroidDevice: correctly handle None output on get_pids_of
It is possible that the command executed by get_pids_of() will return
None (in cases where there are no running processes with the specified
name and the grep call didn't find anything). If that happens, then the
subsequent call to split() failed (as that is not a method of None). To
avoid this, substitute an empty string instead.
2016-10-17 10:54:10 +01:00
Sergei Trofimov
10dd2b304e ApkWorkload: ensure that the APK is always replaced and that a downgrade is allowed. 2016-10-10 13:15:24 +01:00
Sergei Trofimov
93fbb7282a AndroidDevice: added support for downgrade when installing an APK
Adds support for passing -d option to "pm install", which allows
installing an APK when a newer version of the package is already present
on the device.
2016-10-10 12:55:14 +01:00
setrofim
3b052cc619 Merge pull request #266 from marcbonnici/revent
revent: Removed redundant android code
2016-09-30 14:33:52 +01:00