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