mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-03-14 06:38:36 +00:00
Merge 5bed26397b19cb9d448246d3bab224bc78aba1ba into 850fcb24aba95c1dfd99b6b8d536134f8907cea6
This commit is contained in:
commit
a2284d37ce
Binary file not shown.
@ -200,6 +200,7 @@ class ApkWorkload(Workload):
|
||||
self.apk_version = None
|
||||
self.logcat_log = None
|
||||
self.exact_apk_version = None
|
||||
self.applaunch_start_time = None
|
||||
|
||||
def setup(self, context):
|
||||
Workload.setup(self, context)
|
||||
@ -246,6 +247,7 @@ class ApkWorkload(Workload):
|
||||
context.add_classifiers(apk_version=self.apk_version)
|
||||
|
||||
if self.launch_main:
|
||||
self.applaunch_start_time = int(float(self.device.execute('echo $EPOCHREALTIME')) * 1000)
|
||||
self.launch_package() # launch default activity without intent data
|
||||
self.device.execute('am kill-all') # kill all *background* activities
|
||||
self.device.clear_logcat()
|
||||
@ -430,6 +432,13 @@ class ApkWorkload(Workload):
|
||||
def update_result(self, context):
|
||||
self.logcat_log = os.path.join(context.output_directory, 'logcat.log')
|
||||
self.device.dump_logcat(self.logcat_log)
|
||||
#Appending applaunch start time to logcat file
|
||||
logcatfile = open(self.logcat_log, "r+")
|
||||
logcat_content = logcatfile.read()
|
||||
logcatfile.seek(0, 0)
|
||||
applaunchMarker = "UX_PERF : applaunch_start " + str(self.applaunch_start_time)
|
||||
logcatfile.write(applaunchMarker.rstrip('\r\n') + '\n' + logcat_content)
|
||||
logcatfile.close()
|
||||
context.add_iteration_artifact(name='logcat',
|
||||
path='logcat.log',
|
||||
kind='log',
|
||||
|
@ -89,13 +89,13 @@ public class BaseUiAutomation extends UiAutomatorTestCase {
|
||||
|
||||
public void start() {
|
||||
if (enabled) {
|
||||
Log.d("UX_PERF", testTag + "_start " + System.nanoTime());
|
||||
Log.d("UX_PERF", testTag + "_start " + System.currentTimeMillis());
|
||||
}
|
||||
}
|
||||
|
||||
public void stop() throws Exception {
|
||||
if (enabled) {
|
||||
Log.d("UX_PERF", testTag + "_end " + System.nanoTime());
|
||||
Log.d("UX_PERF", testTag + "_end " + System.currentTimeMillis());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ class UxPerfParser(object):
|
||||
for action, timestamps in self.actions.iteritems():
|
||||
# nanosecond precision, but not necessarily nanosecond resolution
|
||||
# truncate to guarantee millisecond precision
|
||||
ts_ms = tuple(int(ts[:-6]) for ts in timestamps)
|
||||
ts_ms = tuple(int(ts) for ts in timestamps)
|
||||
if len(ts_ms) == 2:
|
||||
start, finish = ts_ms
|
||||
duration = finish - start
|
||||
|
Binary file not shown.
@ -16,6 +16,7 @@
|
||||
package com.arm.wlauto.uiauto.adobereader;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
// Import the uiautomator libraries
|
||||
import com.android.uiautomator.core.UiObject;
|
||||
@ -52,6 +53,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
String[] searchStrings =
|
||||
parameters.getString("search_string_list").replace("0space0", " ").split("0newline0");
|
||||
|
||||
Log.d("UX_PERF", "applaunch_end " + System.currentTimeMillis());
|
||||
setScreenOrientation(ScreenOrientation.NATURAL);
|
||||
|
||||
dismissWelcomeView();
|
||||
|
Binary file not shown.
@ -17,6 +17,7 @@ package com.arm.wlauto.uiauto.googlephotos;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.graphics.Rect;
|
||||
import android.util.Log;
|
||||
|
||||
// Import the uiautomator libraries
|
||||
import com.android.uiautomator.core.UiObject;
|
||||
@ -50,6 +51,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
packageID = packageName + ":id/";
|
||||
|
||||
sleep(5); // Pause while splash screen loads
|
||||
Log.d("UX_PERF", "applaunch_end " + System.currentTimeMillis());
|
||||
setScreenOrientation(ScreenOrientation.NATURAL);
|
||||
dismissWelcomeView();
|
||||
closePromotionPopUp();
|
||||
|
Binary file not shown.
@ -16,6 +16,7 @@
|
||||
package com.arm.wlauto.uiauto.googleplaybooks;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
// Import the uiautomator libraries
|
||||
import com.android.uiautomator.core.UiObject;
|
||||
@ -62,6 +63,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
String noteText = "This is a test note";
|
||||
String account = parameters.getString("account");
|
||||
|
||||
Log.d("UX_PERF", "applaunch_end " + System.currentTimeMillis());
|
||||
setScreenOrientation(ScreenOrientation.NATURAL);
|
||||
|
||||
chooseAccount(account);
|
||||
|
Binary file not shown.
@ -22,6 +22,7 @@ import java.util.Map;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
// Import the uiautomator libraries
|
||||
import com.android.uiautomator.core.Configurator;
|
||||
@ -57,6 +58,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
boolean doTextEntry = Boolean.parseBoolean(parameters.getString("do_text_entry"));
|
||||
String workingDirectoryName = parameters.getString("workdir_name");
|
||||
|
||||
Log.d("UX_PERF", "applaunch_end " + System.currentTimeMillis());
|
||||
setScreenOrientation(ScreenOrientation.NATURAL);
|
||||
changeAckTimeout(100);
|
||||
// UI automation begins here
|
||||
|
Binary file not shown.
@ -16,6 +16,7 @@
|
||||
package com.arm.wlauto.uiauto.skype;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
// Import the uiautomator libraries
|
||||
import com.android.uiautomator.core.UiObject;
|
||||
@ -55,6 +56,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
String callType = parameters.getString("action");
|
||||
String resultsFile = parameters.getString("results_file");
|
||||
|
||||
Log.d("UX_PERF", "applaunch_end " + System.currentTimeMillis());
|
||||
setScreenOrientation(ScreenOrientation.NATURAL);
|
||||
|
||||
UiWatcher infoPopUpWatcher = createInfoPopUpWatcher();
|
||||
|
Binary file not shown.
@ -17,6 +17,7 @@ package com.arm.wlauto.uiauto.youtube;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
// Import the uiautomator libraries
|
||||
import com.android.uiautomator.core.UiObject;
|
||||
@ -54,6 +55,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
||||
searchTerm = searchTerm.replace("0space0", " ");
|
||||
}
|
||||
|
||||
Log.d("UX_PERF", "applaunch_end " + System.currentTimeMillis());
|
||||
setScreenOrientation(ScreenOrientation.NATURAL);
|
||||
|
||||
clearFirstRunDialogues();
|
||||
|
Loading…
x
Reference in New Issue
Block a user