diff options
author | Guang Zhu <guangzhu@google.com> | 2010-07-26 17:42:19 -0700 |
---|---|---|
committer | Guang Zhu <guangzhu@google.com> | 2010-07-26 17:42:19 -0700 |
commit | 115798e8de626f5a463f222af6a43a244cc3fa08 (patch) | |
tree | d74a4c09bec4546657ac391aaa91f50d53f05f95 /tests/src/com/android | |
parent | 58008e25deb346bef221ba12d48cd72910fad2bf (diff) | |
download | packages_apps_browser-115798e8de626f5a463f222af6a43a244cc3fa08.zip packages_apps_browser-115798e8de626f5a463f222af6a43a244cc3fa08.tar.gz packages_apps_browser-115798e8de626f5a463f222af6a43a244cc3fa08.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: I4eb0255e2bdf8eea0d3c16797cbb21e1711c3d5b
Diffstat (limited to 'tests/src/com/android')
-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) { |