diff --git a/mobile/android/base/tests/BaseTest.java.in b/mobile/android/base/tests/BaseTest.java.in index 623005eaab3..5ffdd5c40b3 100644 --- a/mobile/android/base/tests/BaseTest.java.in +++ b/mobile/android/base/tests/BaseTest.java.in @@ -83,7 +83,7 @@ abstract class BaseTest extends ActivityInstrumentationTestCase2 { mAsserter.setTestName(this.getClass().getName()); // Set up Robotium.solo and Driver objects - mSolo = new Solo(getInstrumentation()); + mSolo = new Solo(getInstrumentation(), mActivity); mDriver = new FennecNativeDriver(mActivity, mSolo); mActions = new FennecNativeActions(mActivity, mSolo, getInstrumentation(), mAsserter); } @@ -106,11 +106,10 @@ abstract class BaseTest extends ActivityInstrumentationTestCase2 { public void tearDown() throws Exception { try { mAsserter.endTest(); - mSolo.finalize(); + mSolo.finishOpenedActivities(); } catch (Throwable e) { e.printStackTrace(); } - getActivity().finish(); super.tearDown(); } diff --git a/mobile/android/base/tests/testAllPagesTab.java.in b/mobile/android/base/tests/testAllPagesTab.java.in index 9420c40b451..f48b7c022e8 100644 --- a/mobile/android/base/tests/testAllPagesTab.java.in +++ b/mobile/android/base/tests/testAllPagesTab.java.in @@ -137,8 +137,6 @@ public class testAllPagesTab extends BaseTest { } public void tearDown() throws Exception { - super.tearDown(); - ContentResolver resolver = getActivity().getContentResolver(); Uri uri = Uri.parse("content://@ANDROID_PACKAGE_NAME@.db.browser/history"); uri = uri.buildUpon().appendQueryParameter("profile", "default") @@ -146,5 +144,7 @@ public class testAllPagesTab extends BaseTest { resolver.delete(uri, "url = ?", new String[] { "http://mochi.test:8888/tests/robocop/robocop_big_link.html" }); + + super.tearDown(); } } diff --git a/mobile/android/base/tests/testBookmarksTab.java.in b/mobile/android/base/tests/testBookmarksTab.java.in index 9a641a83fe6..d9d55142151 100644 --- a/mobile/android/base/tests/testBookmarksTab.java.in +++ b/mobile/android/base/tests/testBookmarksTab.java.in @@ -212,8 +212,6 @@ public class testBookmarksTab extends BaseTest { } public void tearDown() throws Exception { - super.tearDown(); - ContentResolver resolver = getActivity().getContentResolver(); Uri uri = Uri.parse("content://@ANDROID_PACKAGE_NAME@.db.browser/bookmarks"); uri = uri.buildUpon().appendQueryParameter("profile", "default") @@ -221,5 +219,7 @@ public class testBookmarksTab extends BaseTest { resolver.delete(uri, "title = ?", new String[] { "BOOKMARK_TITLE" }); + + super.tearDown(); } } diff --git a/mobile/android/base/tests/testBrowserProvider.java.in b/mobile/android/base/tests/testBrowserProvider.java.in index e3c55293d4a..27e12346fa0 100644 --- a/mobile/android/base/tests/testBrowserProvider.java.in +++ b/mobile/android/base/tests/testBrowserProvider.java.in @@ -336,10 +336,6 @@ public class testBrowserProvider extends ContentProviderTest { } } - public void tearDown() throws Exception { - super.tearDown(); - } - abstract class Test implements Runnable { public void run() { try { diff --git a/mobile/android/base/tests/testBrowserProviderPerf.java.in b/mobile/android/base/tests/testBrowserProviderPerf.java.in index 0abcdab08ae..f0de0a6051c 100644 --- a/mobile/android/base/tests/testBrowserProviderPerf.java.in +++ b/mobile/android/base/tests/testBrowserProviderPerf.java.in @@ -255,7 +255,4 @@ public class testBrowserProviderPerf extends ContentProviderTest { c.close(); } - public void tearDown() throws Exception { - super.tearDown(); - } } diff --git a/mobile/android/base/tests/testFormHistory.java.in b/mobile/android/base/tests/testFormHistory.java.in index 46c53d78788..b7c1d2dab3b 100644 --- a/mobile/android/base/tests/testFormHistory.java.in +++ b/mobile/android/base/tests/testFormHistory.java.in @@ -108,11 +108,15 @@ public class testFormHistory extends BaseTest { } public void tearDown() throws Exception { - super.tearDown(); - // remove the entire signons.sqlite file File profile = new File(mProfile); File db = new File(profile, "formhistory.sqlite"); - db.delete(); + if (db.delete()) { + mAsserter.dumpLog("tearDown deleted "+db.toString()); + } else { + mAsserter.dumpLog("tearDown did not delete "+db.toString()); + } + + super.tearDown(); } } diff --git a/mobile/android/base/tests/testJarReader.java.in b/mobile/android/base/tests/testJarReader.java.in index c1157ca8d6b..4987563c25b 100644 --- a/mobile/android/base/tests/testJarReader.java.in +++ b/mobile/android/base/tests/testJarReader.java.in @@ -69,7 +69,4 @@ public class testJarReader extends BaseTest { return new java.util.Scanner(stream).useDelimiter("\\A").next(); } - public void tearDown() throws Exception { - super.tearDown(); - } } diff --git a/mobile/android/base/tests/testMigration.java.in b/mobile/android/base/tests/testMigration.java.in index 5066ea391a0..e821da1bdb0 100644 --- a/mobile/android/base/tests/testMigration.java.in +++ b/mobile/android/base/tests/testMigration.java.in @@ -346,7 +346,11 @@ public class testMigration extends ContentProviderTest { // remove the database file File profile = new File(mProfile); File db = new File(profile, DB_NAME); - db.delete(); + if (db.delete()) { + mAsserter.dumpLog("tearDown deleted "+db.toString()); + } else { + mAsserter.dumpLog("tearDown did not delete "+db.toString()); + } super.tearDown(); } diff --git a/mobile/android/base/tests/testPasswordEncrypt.java.in b/mobile/android/base/tests/testPasswordEncrypt.java.in index 117eafab916..317bd5b911b 100644 --- a/mobile/android/base/tests/testPasswordEncrypt.java.in +++ b/mobile/android/base/tests/testPasswordEncrypt.java.in @@ -147,11 +147,15 @@ public class testPasswordEncrypt extends BaseTest { } public void tearDown() throws Exception { - super.tearDown(); - // remove the entire signons.sqlite file File profile = new File(mProfile); File db = new File(profile, "signons.sqlite"); - db.delete(); + if (db.delete()) { + mAsserter.dumpLog("tearDown deleted "+db.toString()); + } else { + mAsserter.dumpLog("tearDown did not delete "+db.toString()); + } + + super.tearDown(); } } diff --git a/mobile/android/base/tests/testPasswordProvider.java.in b/mobile/android/base/tests/testPasswordProvider.java.in index 1fcd846d5f3..9ace65b6a29 100644 --- a/mobile/android/base/tests/testPasswordProvider.java.in +++ b/mobile/android/base/tests/testPasswordProvider.java.in @@ -85,11 +85,15 @@ public class testPasswordProvider extends BaseTest { } public void tearDown() throws Exception { - super.tearDown(); - // remove the entire signons.sqlite file File profile = new File(mProfile); File db = new File(profile, "signons.sqlite"); - db.delete(); + if (db.delete()) { + mAsserter.dumpLog("tearDown deleted "+db.toString()); + } else { + mAsserter.dumpLog("tearDown did not delete "+db.toString()); + } + + super.tearDown(); } }