1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-02 03:12:34 +01:00

cameracapture & camerarecord: Updated workloads to work with Android M+

The stock camera app as of Android M has changed. This commit updates
the ui automation to work with this new app. As part of this change
it was required to bump the API level of the ui automation to 18.

Also made the teardown of the capture workload close the app like the
record workload.
This commit is contained in:
Sebastian Goscik
2016-05-13 14:52:22 +01:00
parent 46cd26e774
commit 5a1c8c7a7e
9 changed files with 211 additions and 35 deletions

View File

@@ -111,7 +111,6 @@ def list_of_numbers(value):
"""
Value must be iterable. All elements will be converted to numbers (either ``ints`` or
``float``\ s depending on the elements).
"""
if not isiterable(value):
raise ValueError(value)
@@ -300,3 +299,32 @@ class arguments(list):
def __str__(self):
return ' '.join(self)
class range_dict(dict):
"""
This dict allows you to specify mappings with a range.
If a key is not in the dict it will search downward until
the next key and return its value. E.g:
If:
a[5] = "Hello"
a[10] = "There"
Then:
a[2] == None
a[7] == "Hello"
a[999] == "There"
"""
def __getitem__(self, i):
key = int(i)
while key not in self and key > 0:
key -= 1
if key <= 0:
raise KeyError(i)
return dict.__getitem__(self, key)
def __setitem__(self, i, v):
i = int(i)
super(range_dict, self).__setitem__(i, v)