summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAngus Kong <shkong@google.com>2011-10-14 17:11:12 +0800
committerAngus Kong <shkong@google.com>2011-10-17 16:20:39 +0800
commit52c5c76bddbf3994867a00d0e266b390592486aa (patch)
treec7ad8ffb4665263464c8bd8b23c93820fe27df1c /tests
parent267bccfc197cdb2eaa44a0a96c8138863d1cc0bc (diff)
downloadLegacyCamera-52c5c76bddbf3994867a00d0e266b390592486aa.zip
LegacyCamera-52c5c76bddbf3994867a00d0e266b390592486aa.tar.gz
LegacyCamera-52c5c76bddbf3994867a00d0e266b390592486aa.tar.bz2
Add "Intent.FLAG_ACTIVITY_CLEAR_TOP" flag in test.
The "Intent.FLAG_ACTIVITY_CLEAR_TOP" should be added in the intent for switching modes. This flag ensures there is only 1 instance of the same activity. This behavior is the same as how we do in the app. bug:5336037 Change-Id: Ie76b43cbd87ff9e8a7ec9e0a892930834dccf9cf
Diffstat (limited to 'tests')
-rwxr-xr-xtests/src/com/android/camera/stress/SwitchPreview.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/src/com/android/camera/stress/SwitchPreview.java b/tests/src/com/android/camera/stress/SwitchPreview.java
index 6af915e..c5dd7c1 100755
--- a/tests/src/com/android/camera/stress/SwitchPreview.java
+++ b/tests/src/com/android/camera/stress/SwitchPreview.java
@@ -97,10 +97,13 @@ public class SwitchPreview extends ActivityInstrumentationTestCase2 <VideoCamera
for (int i=0; i< TOTAL_NUMBER_OF_SWITCHING; i++) {
Thread.sleep(WAIT_FOR_PREVIEW);
Intent intent = new Intent();
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.setClass(getInstrumentation().getTargetContext(),
VideoCamera.class);
getActivity().startActivity(intent);
Thread.sleep(WAIT_FOR_PREVIEW);
+ intent = new Intent();
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.setClass(getInstrumentation().getTargetContext(),
Camera.class);
getActivity().startActivity(intent);