mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 969922 - Pre: Close cursor. r=mcomella
This commit is contained in:
parent
af12f68960
commit
fdccafb785
@ -13,6 +13,8 @@ import android.util.Log;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import org.mozilla.gecko.db.BrowserContract;
|
||||
|
||||
/*
|
||||
* This test is meant to exercise all operations exposed by Fennec's
|
||||
* history and bookmarks content provider. It does so in an isolated
|
||||
@ -158,10 +160,17 @@ public class testBrowserProvider extends ContentProviderTest {
|
||||
}
|
||||
|
||||
private void loadMobileFolderId() throws Exception {
|
||||
Cursor c = getBookmarkByGuid(MOBILE_FOLDER_GUID);
|
||||
mAsserter.is(c.moveToFirst(), true, "Mobile bookmarks folder is present");
|
||||
Cursor c = null;
|
||||
try {
|
||||
c = getBookmarkByGuid(BrowserContract.Bookmarks.MOBILE_FOLDER_GUID);
|
||||
mAsserter.is(c.moveToFirst(), true, "Mobile bookmarks folder is present");
|
||||
|
||||
mMobileFolderId = c.getLong(c.getColumnIndex(mBookmarksIdCol));
|
||||
mMobileFolderId = c.getLong(c.getColumnIndex(BrowserContract.Bookmarks._ID));
|
||||
} finally {
|
||||
if (c != null) {
|
||||
c.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ensureEmptyDatabase() throws Exception {
|
||||
|
Loading…
Reference in New Issue
Block a user