Bug 774833 - Robocop: use finishOpenedActivities instead of finalize; r=jmaher

This commit is contained in:
Geoff Brown 2012-08-14 08:49:59 -06:00
parent feda695c89
commit c7a193cf28
10 changed files with 32 additions and 27 deletions

View File

@ -83,7 +83,7 @@ abstract class BaseTest extends ActivityInstrumentationTestCase2<Activity> {
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<Activity> {
public void tearDown() throws Exception {
try {
mAsserter.endTest();
mSolo.finalize();
mSolo.finishOpenedActivities();
} catch (Throwable e) {
e.printStackTrace();
}
getActivity().finish();
super.tearDown();
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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 {

View File

@ -255,7 +255,4 @@ public class testBrowserProviderPerf extends ContentProviderTest {
c.close();
}
public void tearDown() throws Exception {
super.tearDown();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}

View File

@ -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();
}
}

View File

@ -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();
}
}