summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGuang Zhu <guangzhu@google.com>2010-07-26 17:42:19 -0700
committerGuang Zhu <guangzhu@google.com>2010-08-09 13:29:08 -0700
commitdb8a53fa5eda4ba60733775ca62e4dd914259c52 (patch)
tree79cde8a84a2dc96249d9975b1230b75c4e67e797 /tests
parent96f9a830f9072f6bbf8bb73d611430f8ed314bc1 (diff)
downloadpackages_apps_Browser-db8a53fa5eda4ba60733775ca62e4dd914259c52.tar.gz
packages_apps_Browser-db8a53fa5eda4ba60733775ca62e4dd914259c52.tar.bz2
packages_apps_Browser-db8a53fa5eda4ba60733775ca62e4dd914259c52.zip
fix crash recovery bug in PopularUrlsTest
Currently the test does not increment page count after relaunched after a crash. This means the crashed page will be loaded again, causing a dead loop. Change-Id: If4591fbd05521f0454151affafec09788e9208d9
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/browser/PopularUrlsTest.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/tests/src/com/android/browser/PopularUrlsTest.java b/tests/src/com/android/browser/PopularUrlsTest.java
index b1760e9cd..547cb9f4b 100644
--- a/tests/src/com/android/browser/PopularUrlsTest.java
+++ b/tests/src/com/android/browser/PopularUrlsTest.java
@@ -307,7 +307,6 @@ public class PopularUrlsTest extends ActivityInstrumentationTestCase2<BrowserAct
public void write() throws IOException {
FileWriter output = null;
- OutputStreamWriter writer = null;
if (mFile.exists()) {
mFile.delete();
}
@@ -317,14 +316,8 @@ public class PopularUrlsTest extends ActivityInstrumentationTestCase2<BrowserAct
output.write(page + newLine);
output.write(url + newLine);
} finally {
- try {
- if (writer != null) {
- writer.close();
- }
- } finally {
- if (output != null) {
- output.close();
- }
+ if (output != null) {
+ output.close();
}
}
}
@@ -394,6 +387,7 @@ public class PopularUrlsTest extends ActivityInstrumentationTestCase2<BrowserAct
if (mStatus.getIsRecovery()) {
Log.e(TAG, "Recovering after crash: " + iterator.next());
+ mStatus.incrementPage();
}
while (mStatus.getIteration() < loopCount) {