diff options
author | Guang Zhu <guangzhu@google.com> | 2009-06-29 10:40:55 -0700 |
---|---|---|
committer | Guang Zhu <guangzhu@google.com> | 2009-06-29 14:45:50 -0700 |
commit | f92bd42a702af7047ac4bd7c95b4a82973b7a79d (patch) | |
tree | a8daf4432dd502a060612e600b84ea96f85da86c /tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java | |
parent | 61ab270c17094ef1373f54d8fb9ade6d287c3a60 (diff) |
Added a new operation mode where user can launch all tests under a folder from test app ui.
Diffstat (limited to 'tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java')
-rw-r--r-- | tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java b/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java index 16973beb8691..de39800149a3 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java @@ -45,7 +45,7 @@ public class ReliabilityTest extends ActivityInstrumentationTestCase2<Reliabilit //always try to resume first, hence cleaning up status will be the //responsibility of driver scripts - String lastUrl = readTestStatus(); + String lastUrl = FsUtils.readTestStatus(TEST_STATUS_FILE); if(lastUrl != null && !TEST_DONE.equals(lastUrl)) fastForward(listReader, lastUrl); @@ -62,7 +62,7 @@ public class ReliabilityTest extends ActivityInstrumentationTestCase2<Reliabilit continue; start = System.currentTimeMillis(); Log.v(LOGTAG, "Testing URL: " + url); - updateTestStatus(url); + FsUtils.updateTestStatus(TEST_STATUS_FILE, url); activity.reset(); //use message to send new URL to avoid interacting with //WebView in non-UI thread @@ -92,7 +92,7 @@ public class ReliabilityTest extends ActivityInstrumentationTestCase2<Reliabilit System.gc(); System.gc(); } - updateTestStatus(TEST_DONE); + FsUtils.updateTestStatus(TEST_STATUS_FILE, TEST_DONE); activity.finish(); listReader.close(); } @@ -122,35 +122,6 @@ public class ReliabilityTest extends ActivityInstrumentationTestCase2<Reliabilit } } - private void updateTestStatus(String s) { - // write last tested url into status file - try { - BufferedOutputStream bos = new BufferedOutputStream( - new FileOutputStream(TEST_STATUS_FILE)); - bos.write(s.getBytes()); - bos.close(); - } catch (IOException e) { - Log.e(LOGTAG, "Cannot update file " + TEST_STATUS_FILE, e); - } - } - - private String readTestStatus() { - // read out the test name it stopped last time. - String status = null; - File testStatusFile = new File(TEST_STATUS_FILE); - if(testStatusFile.exists()) { - try { - BufferedReader inReader = new BufferedReader( - new FileReader(testStatusFile)); - status = inReader.readLine(); - inReader.close(); - } catch (IOException e) { - Log.e(LOGTAG, "Error reading test status.", e); - } - } - return status; - } - private void fastForward(BufferedReader testListReader, String lastUrl) { //fastforward the BufferedReader to the position right after last url if(lastUrl == null) |