diff options
author | Guang Zhu <guangzhu@google.com> | 2011-02-18 11:13:39 -0800 |
---|---|---|
committer | Guang Zhu <guangzhu@google.com> | 2011-02-18 11:13:39 -0800 |
commit | 1bfab02d46cff0a6cef679dfbfc72007270b705e (patch) | |
tree | e06a837c0b9f7ba1cf2f37c229ece809c0e4c8a7 | |
parent | 7de6ed00f051c97d44ae579c003d1fed68352bec (diff) | |
download | android_packages_apps_Gello-1bfab02d46cff0a6cef679dfbfc72007270b705e.tar.gz android_packages_apps_Gello-1bfab02d46cff0a6cef679dfbfc72007270b705e.tar.bz2 android_packages_apps_Gello-1bfab02d46cff0a6cef679dfbfc72007270b705e.zip |
fix a bug in crash handling
currently, if a page load ended up in Java crash, the crash will be
intercepted by test harness and during the test tearDown step, the
test status file will be removed, and the harness would think all
sites have been loaded successfully
Change-Id: Ifc02d7f4b7e76c8e8aad06fff273f9d61060874d
-rw-r--r-- | tests/src/com/android/browser/PopularUrlsTest.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/src/com/android/browser/PopularUrlsTest.java b/tests/src/com/android/browser/PopularUrlsTest.java index 5e367be5..3e7515f2 100644 --- a/tests/src/com/android/browser/PopularUrlsTest.java +++ b/tests/src/com/android/browser/PopularUrlsTest.java @@ -305,12 +305,14 @@ public class PopularUrlsTest extends ActivityInstrumentationTestCase2<BrowserAct private int page; private String url; private boolean isRecovery; + private boolean allClear; private RunStatus(File file) throws IOException { mFile = file; FileReader input = null; BufferedReader reader = null; isRecovery = false; + allClear = false; iteration = 0; page = 0; try { @@ -369,7 +371,9 @@ public class PopularUrlsTest extends ActivityInstrumentationTestCase2<BrowserAct } public void cleanUp() { - if (mFile.exists()) { + // only perform cleanup when allClear flag is set + // i.e. when the test was not interrupted by a Java crash + if (mFile.exists() && allClear) { mFile.delete(); } } @@ -380,6 +384,7 @@ public class PopularUrlsTest extends ActivityInstrumentationTestCase2<BrowserAct public void incrementPage() { ++page; + allClear = true; } public void incrementIteration() { @@ -400,6 +405,7 @@ public class PopularUrlsTest extends ActivityInstrumentationTestCase2<BrowserAct public void setUrl(String url) { this.url = url; + allClear = false; } } |