summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYu Shan Emily Lau <yslau@google.com>2009-12-01 17:13:55 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-01 17:13:55 -0800
commit7dfaf5446aa8f49823dbace45ae358e2c53e865c (patch)
tree10a5e59a2efda377d85478fea20a60c3f670b7f6 /tests
parent2927e79158f23ce910deaf9b6fdf69282d4201cc (diff)
parent5e4deaf0aaf218d1c6ccf5f86ee7ca38bafa5c45 (diff)
downloadLegacyCamera-7dfaf5446aa8f49823dbace45ae358e2c53e865c.zip
LegacyCamera-7dfaf5446aa8f49823dbace45ae358e2c53e865c.tar.gz
LegacyCamera-7dfaf5446aa8f49823dbace45ae358e2c53e865c.tar.bz2
am 5e4deaf0: Merge change I94d56d71 into eclair
Merge commit '5e4deaf0aaf218d1c6ccf5f86ee7ca38bafa5c45' into eclair-mr2 * commit '5e4deaf0aaf218d1c6ccf5f86ee7ca38bafa5c45': Split the startup measurment into two parts.
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/camera/stress/CameraStartUp.java53
1 files changed, 35 insertions, 18 deletions
diff --git a/tests/src/com/android/camera/stress/CameraStartUp.java b/tests/src/com/android/camera/stress/CameraStartUp.java
index 71325d2..b59d724 100644
--- a/tests/src/com/android/camera/stress/CameraStartUp.java
+++ b/tests/src/com/android/camera/stress/CameraStartUp.java
@@ -70,17 +70,22 @@ public class CameraStartUp extends InstrumentationTestCase {
}
private void writeToOutputFile(String startupTag, long totalStartupTime,
- String individualStartupTime) throws Exception {
- //TODO (yslau) : Need to integrate the output data with central dashboard
+ String individualStartupTime, boolean firstStartUp) throws Exception {
+ // TODO (yslau) : Need to integrate the output data with central
+ // dashboard
try {
FileWriter fstream = null;
fstream = new FileWriter(CAMERA_TEST_OUTPUT_FILE, true);
- long averageStartupTime = totalStartupTime / TOTAL_NUMBER_OF_STARTUP;
BufferedWriter out = new BufferedWriter(fstream);
- out.write(startupTag + "\n");
- out.write("Number of loop: " + TOTAL_NUMBER_OF_STARTUP + "\n");
- out.write(individualStartupTime + "\n\n");
- out.write("Average startup time :" + averageStartupTime + " ms\n\n");
+ if (firstStartUp) {
+ out.write(startupTag + ": " + totalStartupTime + "\n");
+ } else {
+ long averageStartupTime = totalStartupTime / (TOTAL_NUMBER_OF_STARTUP -1);
+ out.write(startupTag + "\n");
+ out.write("Number of loop: " + (TOTAL_NUMBER_OF_STARTUP -1) + "\n");
+ out.write(individualStartupTime + "\n\n");
+ out.write("Average startup time :" + averageStartupTime + " ms\n\n");
+ }
out.close();
fstream.close();
} catch (Exception e) {
@@ -94,29 +99,41 @@ public class CameraStartUp extends InstrumentationTestCase {
individualStartupTime = "Individual Video Startup Time = ";
long totalStartupTime = 0;
long startupTime = 0;
- for ( int i =0; i< TOTAL_NUMBER_OF_STARTUP; i++){
- startupTime = launchVideo();
- totalStartupTime += startupTime;
- individualStartupTime += startupTime + " ,";
+ for (int i = 0; i < TOTAL_NUMBER_OF_STARTUP; i++) {
+ if (i == 0) {
+ // Capture the first startup time individually
+ long firstStartUpTime = launchVideo();
+ writeToOutputFile("First Video Startup: ", firstStartUpTime, "na", true);
+ } else {
+ startupTime = launchVideo();
+ totalStartupTime += startupTime;
+ individualStartupTime += startupTime + " ,";
+ }
}
Log.v(TAG, "totalStartupTime =" + totalStartupTime);
writeToOutputFile("Video Recorder Startup Time: ", totalStartupTime,
- individualStartupTime);
+ individualStartupTime, false);
}
@LargeTest
public void testLaunchCamera() throws Exception {
String individualStartupTime;
individualStartupTime = "Individual Camera Startup Time = ";
- long totalStartupTime =0;
+ long totalStartupTime = 0;
long startupTime = 0;
- for ( int i =0; i< TOTAL_NUMBER_OF_STARTUP; i++){
- startupTime = launchCamera();
- totalStartupTime += startupTime;
- individualStartupTime += startupTime + " ,";
+ for (int i = 0; i < TOTAL_NUMBER_OF_STARTUP; i++) {
+ if (i == 0) {
+ // Capture the first startup time individually
+ long firstStartUpTime = launchCamera();
+ writeToOutputFile("First Camera Startup: ", firstStartUpTime, "na", true);
+ } else {
+ startupTime = launchCamera();
+ totalStartupTime += startupTime;
+ individualStartupTime += startupTime + " ,";
+ }
}
Log.v(TAG, "totalStartupTime =" + totalStartupTime);
writeToOutputFile("Camera Startup Time: ", totalStartupTime,
- individualStartupTime);
+ individualStartupTime, false);
}
} \ No newline at end of file