diff options
author | Guang Zhu <guangzhu@google.com> | 2010-07-26 17:42:19 -0700 |
---|---|---|
committer | Guang Zhu <guangzhu@google.com> | 2010-08-09 13:29:08 -0700 |
commit | db8a53fa5eda4ba60733775ca62e4dd914259c52 (patch) | |
tree | 79cde8a84a2dc96249d9975b1230b75c4e67e797 | |
parent | 96f9a830f9072f6bbf8bb73d611430f8ed314bc1 (diff) | |
download | packages_apps_Browser-db8a53fa5eda4ba60733775ca62e4dd914259c52.zip packages_apps_Browser-db8a53fa5eda4ba60733775ca62e4dd914259c52.tar.gz packages_apps_Browser-db8a53fa5eda4ba60733775ca62e4dd914259c52.tar.bz2 |
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
-rw-r--r-- | tests/src/com/android/browser/PopularUrlsTest.java | 12 |
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 b1760e9..547cb9f 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) { |