summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGuang Zhu <guangzhu@google.com>2010-06-16 14:57:25 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-06-16 14:57:25 -0700
commit334961ada14e5d44de2f6f16ee1e6b45f860ec45 (patch)
treecfce89aef4c4a5724c60c73dbd14705c0b76d624 /tests
parent026ffeb8091949eb89261898bc1ab0daff6be1a9 (diff)
parent6cb16461e1524eb3272b4e9440db6c041feacbb3 (diff)
downloadpackages_apps_Browser-334961ada14e5d44de2f6f16ee1e6b45f860ec45.zip
packages_apps_Browser-334961ada14e5d44de2f6f16ee1e6b45f860ec45.tar.gz
packages_apps_Browser-334961ada14e5d44de2f6f16ee1e6b45f860ec45.tar.bz2
am 6cb16461: am 91825062: add check for FileNotFoundException
Merge commit '6cb16461e1524eb3272b4e9440db6c041feacbb3' * commit '6cb16461e1524eb3272b4e9440db6c041feacbb3': add check for FileNotFoundException
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/browser/PopularUrlsTest.java32
1 files changed, 19 insertions, 13 deletions
diff --git a/tests/src/com/android/browser/PopularUrlsTest.java b/tests/src/com/android/browser/PopularUrlsTest.java
index d3806a0..5b8cb86 100644
--- a/tests/src/com/android/browser/PopularUrlsTest.java
+++ b/tests/src/com/android/browser/PopularUrlsTest.java
@@ -16,19 +16,6 @@
package com.android.browser;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
import android.app.Instrumentation;
import android.content.Intent;
import android.net.Uri;
@@ -42,6 +29,19 @@ import android.webkit.JsResult;
import android.webkit.SslErrorHandler;
import android.webkit.WebView;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
/**
*
* Iterates over a list of URLs from a file and outputs the time to load each.
@@ -423,6 +423,9 @@ public class PopularUrlsTest extends ActivityInstrumentationTestCase2<BrowserAct
bufferedReader.close();
}
}
+ } catch (FileNotFoundException fnfe) {
+ Log.e(TAG, fnfe.getMessage(), fnfe);
+ fail("Test environment not setup correctly");
} finally {
if (writer != null) {
writer.close();
@@ -436,6 +439,9 @@ public class PopularUrlsTest extends ActivityInstrumentationTestCase2<BrowserAct
BufferedReader bufferedReader = getInputStream();
try {
loopUrls(bufferedReader, null, true, STABILITY_LOOPCOUNT);
+ } catch (FileNotFoundException fnfe) {
+ Log.e(TAG, fnfe.getMessage(), fnfe);
+ fail("Test environment not setup correctly");
} finally {
if (bufferedReader != null) {
bufferedReader.close();