Bug 1046709 - Part 5: Delete history db extensions related stuff r=nalexander,rnewman
authorGrigory Kruglov <gkruglov@mozilla.com>
Tue, 12 Apr 2016 15:52:53 -0700
changeset 331669 4639a73a29d3bc5b145c98517bba9170b7cf7c49
parent 331668 661901c98bea8eaeb63859c0394d171e3f5da274
child 331670 1daa36fd1395c78c182743f3fbcea8a515e727f1
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander, rnewman
bugs1046709
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1046709 - Part 5: Delete history db extensions related stuff r=nalexander,rnewman - class - tests MozReview-Commit-ID: LwHo5Ej2FGS
mobile/android/base/java/org/mozilla/gecko/db/BrowserContract.java
mobile/android/services/src/main/java/org/mozilla/gecko/fxa/receivers/FxAccountDeletedService.java
mobile/android/services/src/main/java/org/mozilla/gecko/sync/repositories/android/AndroidBrowserHistoryDataExtender.java
mobile/android/tests/background/junit3/background_junit3_sources.mozbuild
mobile/android/tests/background/junit3/instrumentation.ini
mobile/android/tests/background/junit3/src/org/mozilla/gecko/background/db/TestAndroidBrowserHistoryDataExtender.java
mobile/android/tests/background/junit3/src/org/mozilla/gecko/background/db/TestAndroidBrowserHistoryRepository.java
mobile/android/tests/background/junit3/src/org/mozilla/gecko/background/db/TestCachedSQLiteOpenHelper.java
--- a/mobile/android/base/java/org/mozilla/gecko/db/BrowserContract.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/BrowserContract.java
@@ -222,18 +222,16 @@ public class BrowserContract {
 
     @RobocopTarget
     public static final class Visits implements CommonColumns, VisitsColumns {
         private Visits() {}
 
         public static final String TABLE_NAME = "visits";
 
         public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "visits");
-        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/visits";
-        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/visits";
     }
 
     // Combined bookmarks and history
     @RobocopTarget
     public static final class Combined implements CommonColumns, URLColumns, HistoryColumns, FaviconColumns  {
         private Combined() {}
 
         public static final String VIEW_NAME = "combined";
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/receivers/FxAccountDeletedService.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/receivers/FxAccountDeletedService.java
@@ -8,17 +8,16 @@ import java.util.concurrent.Executor;
 
 import org.mozilla.gecko.background.common.log.Logger;
 import org.mozilla.gecko.background.fxa.oauth.FxAccountAbstractClient;
 import org.mozilla.gecko.background.fxa.oauth.FxAccountAbstractClientException.FxAccountAbstractClientRemoteException;
 import org.mozilla.gecko.background.fxa.oauth.FxAccountOAuthClient10;
 import org.mozilla.gecko.fxa.FxAccountConstants;
 import org.mozilla.gecko.fxa.sync.FxAccountNotificationManager;
 import org.mozilla.gecko.fxa.sync.FxAccountSyncAdapter;
-import org.mozilla.gecko.sync.repositories.android.AndroidBrowserHistoryDataExtender;
 import org.mozilla.gecko.sync.repositories.android.ClientsDatabase;
 import org.mozilla.gecko.sync.repositories.android.FennecTabsRepository;
 
 import android.app.IntentService;
 import android.content.Context;
 import android.content.Intent;
 
 /**
@@ -82,32 +81,16 @@ public class FxAccountDeletedService ext
         if (db != null) {
           db.close();
         }
       }
     } catch (Exception e) {
       Logger.warn(LOG_TAG, "Got exception deleting the Firefox Sync clients database; ignoring.", e);
     }
 
-    // Clear Firefox Sync history data table.
-    try {
-      Logger.info(LOG_TAG, "Deleting the Firefox Sync extended history database.");
-      AndroidBrowserHistoryDataExtender historyDataExtender = null;
-      try {
-        historyDataExtender = new AndroidBrowserHistoryDataExtender(context);
-        historyDataExtender.wipe();
-      } finally {
-        if (historyDataExtender != null) {
-          historyDataExtender.close();
-        }
-      }
-    } catch (Exception e) {
-      Logger.warn(LOG_TAG, "Got exception deleting the Firefox Sync extended history database; ignoring.", e);
-    }
-
     // Remove any displayed notifications.
     new FxAccountNotificationManager(FxAccountSyncAdapter.NOTIFICATION_ID).clear(context);
 
     // Bug 1147275: Delete cached oauth tokens. There's no way to query all
     // oauth tokens from Android, so this is tricky to do comprehensively. We
     // can query, individually, for specific oauth tokens to delete, however.
     final String oauthServerURI = intent.getStringExtra(FxAccountConstants.ACCOUNT_OAUTH_SERVICE_ENDPOINT_KEY);
     final String[] tokens = intent.getStringArrayExtra(FxAccountConstants.ACCOUNT_DELETED_INTENT_ACCOUNT_AUTH_TOKENS);
deleted file mode 100644
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/sync/repositories/android/AndroidBrowserHistoryDataExtender.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.gecko.sync.repositories.android;
-
-import java.util.ArrayList;
-
-import org.json.simple.JSONArray;
-import org.mozilla.gecko.background.common.log.Logger;
-import org.mozilla.gecko.sync.repositories.NullCursorException;
-import org.mozilla.gecko.sync.repositories.domain.HistoryRecord;
-
-import android.content.ContentValues;
-import android.content.Context;
-import android.database.Cursor;
-import android.database.SQLException;
-import android.database.sqlite.SQLiteDatabase;
-
-public class AndroidBrowserHistoryDataExtender extends CachedSQLiteOpenHelper {
-
-  public static final String LOG_TAG = "SyncHistoryVisits";
-
-  // Database Specifications.
-  protected static final String DB_NAME = "history_extension_database";
-  protected static final int SCHEMA_VERSION = 1;
-
-  // History Table.
-  public static final String   TBL_HISTORY_EXT = "HistoryExtension";
-  public static final String   COL_GUID = "guid";
-  public static final String   GUID_IS = COL_GUID + " = ?";
-  public static final String   COL_VISITS = "visits";
-  public static final String[] TBL_COLUMNS = { COL_GUID, COL_VISITS };
-
-  private final RepoUtils.QueryHelper queryHelper;
-
-  public AndroidBrowserHistoryDataExtender(Context context) {
-    super(context, DB_NAME, null, SCHEMA_VERSION);
-    this.queryHelper = new RepoUtils.QueryHelper(context, null, LOG_TAG);
-  }
-
-  @Override
-  public void onCreate(SQLiteDatabase db) {
-    String createTableSql = "CREATE TABLE " + TBL_HISTORY_EXT + " ("
-        + COL_GUID + " TEXT PRIMARY KEY, "
-        + COL_VISITS + " TEXT)";
-    db.execSQL(createTableSql);
-  }
-
-  @Override
-  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
-    // For now we'll just drop and recreate the tables.
-    db.execSQL("DROP TABLE IF EXISTS " + TBL_HISTORY_EXT);
-    onCreate(db);
-  }
-
-  public void wipe() {
-    SQLiteDatabase db = this.getCachedWritableDatabase();
-    onUpgrade(db, SCHEMA_VERSION, SCHEMA_VERSION);
-  }
-
-  /**
-   * Store visit data.
-   *
-   * If a row with GUID `guid` does not exist, insert a new row.
-   * If a row with GUID `guid` does exist, replace the visits column.
-   *
-   * @param db The database to write to; must not be null.
-   * @param guid The GUID to store to; must not be null.
-   * @param visits New visits data.
-   */
-  protected void store(SQLiteDatabase db, String guid, JSONArray visits) {
-    ContentValues cv = new ContentValues();
-    cv.put(COL_GUID, guid);
-    if (visits == null) {
-      cv.put(COL_VISITS, "[]");
-    } else {
-      cv.put(COL_VISITS, visits.toJSONString());
-    }
-
-    String[] args = new String[] { guid };
-    int rowsUpdated = db.update(TBL_HISTORY_EXT, cv, GUID_IS, args);
-    if (rowsUpdated >= 1) {
-      Logger.debug(LOG_TAG, "Replaced history extension record for row with GUID " + guid);
-    } else {
-      long rowId = db.insert(TBL_HISTORY_EXT, null, cv);
-      Logger.debug(LOG_TAG, "Inserted history extension record into row: " + rowId);
-    }
-  }
-
-  /**
-   * Store visit data.
-   *
-   * If a row with GUID `guid` does not exist, insert a new row.
-   * If a row with GUID `guid` does exist, replace the visits column.
-   *
-   * @param guid the GUID to store; must not be null.
-   * @param visits new visits data.
-   */
-  public void store(String guid, JSONArray visits) {
-    SQLiteDatabase db = this.getCachedWritableDatabase();
-    store(db, guid, visits);
-  }
-
-  /**
-   * Store (update or insert) visit data in a single database transaction.
-   */
-  public void bulkInsert(ArrayList<HistoryRecord> records) {
-    SQLiteDatabase db = this.getCachedWritableDatabase();
-    try {
-      db.beginTransaction();
-
-      for (HistoryRecord record : records) {
-        store(db, record.guid, record.visits);
-      }
-
-      db.setTransactionSuccessful();
-    } catch (SQLException e) {
-      Logger.error(LOG_TAG, "Caught exception in bulkInsert new history visits.", e);
-    } finally {
-      db.endTransaction();
-    }
-  }
-
-  /**
-   * Fetch a row.
-   *
-   * @param guid The GUID of the row to fetch.
-   * @return A Cursor.
-   * @throws NullCursorException
-   */
-  public Cursor fetch(String guid) throws NullCursorException {
-    String[] args = new String[] { guid };
-
-    SQLiteDatabase db = this.getCachedReadableDatabase();
-    Cursor cur = queryHelper.safeQuery(db, ".fetch",
-        TBL_HISTORY_EXT, TBL_COLUMNS, GUID_IS, args);
-    return cur;
-  }
-
-  public JSONArray visitsForGUID(String guid) throws NullCursorException {
-    if (guid == null) {
-      Logger.warn(LOG_TAG, "Asked for visits for null GUID.");
-      return new JSONArray();
-    }
-
-    Logger.debug(LOG_TAG, "Fetching visits for GUID " + guid);
-    Cursor visits = fetch(guid);
-    try {
-      if (!visits.moveToFirst()) {
-        // Cursor is empty.
-        return new JSONArray();
-      } else {
-        return RepoUtils.getJSONArrayFromCursor(visits, COL_VISITS);
-      }
-    } finally {
-      visits.close();
-    }
-  }
-
-  /**
-   * Delete a row.
-   *
-   * @param guid the GUID of the row to delete.
-   * @return The number of rows deleted, either 0 (if a row with this GUID does not exist) or 1.
-   */
-  public int delete(String guid) {
-    String[] args = new String[] { guid };
-
-    SQLiteDatabase db = this.getCachedWritableDatabase();
-    return db.delete(TBL_HISTORY_EXT, GUID_IS, args);
-  }
-
-  /**
-   * Fetch all rows.
-   *
-   * @return a <code>Cursor</code>.
-   * @throws NullCursorException
-   */
-  public Cursor fetchAll() throws NullCursorException {
-    SQLiteDatabase db = this.getCachedReadableDatabase();
-    Cursor cur = queryHelper.safeQuery(db, ".fetchAll", TBL_HISTORY_EXT,
-        TBL_COLUMNS,
-        null, null);
-    return cur;
-  }
-}
--- a/mobile/android/tests/background/junit3/background_junit3_sources.mozbuild
+++ b/mobile/android/tests/background/junit3/background_junit3_sources.mozbuild
@@ -6,20 +6,18 @@
 
 background_junit3_sources = [
     'src/org/mozilla/gecko/background/common/TestAndroidLogWriters.java',
     'src/org/mozilla/gecko/background/common/TestBrowserContractHelpers.java',
     'src/org/mozilla/gecko/background/common/TestUtils.java',
     'src/org/mozilla/gecko/background/common/TestWaitHelper.java',
     'src/org/mozilla/gecko/background/db/AndroidBrowserRepositoryTestCase.java',
     'src/org/mozilla/gecko/background/db/TestAndroidBrowserBookmarksRepository.java',
-    'src/org/mozilla/gecko/background/db/TestAndroidBrowserHistoryDataExtender.java',
     'src/org/mozilla/gecko/background/db/TestAndroidBrowserHistoryRepository.java',
     'src/org/mozilla/gecko/background/db/TestBookmarks.java',
-    'src/org/mozilla/gecko/background/db/TestCachedSQLiteOpenHelper.java',
     'src/org/mozilla/gecko/background/db/TestClientsDatabase.java',
     'src/org/mozilla/gecko/background/db/TestClientsDatabaseAccessor.java',
     'src/org/mozilla/gecko/background/db/TestFennecTabsRepositorySession.java',
     'src/org/mozilla/gecko/background/db/TestFormHistoryRepositorySession.java',
     'src/org/mozilla/gecko/background/db/TestPasswordsRepository.java',
     'src/org/mozilla/gecko/background/db/TestTopSites.java',
     'src/org/mozilla/gecko/background/fxa/authenticator/TestAccountPickler.java',
     'src/org/mozilla/gecko/background/fxa/TestAccountLoader.java',
--- a/mobile/android/tests/background/junit3/instrumentation.ini
+++ b/mobile/android/tests/background/junit3/instrumentation.ini
@@ -1,20 +1,18 @@
 [DEFAULT]
 subsuite = background
 
 [src/org/mozilla/gecko/background/common/TestAndroidLogWriters.java]
 [src/org/mozilla/gecko/background/common/TestBrowserContractHelpers.java]
 [src/org/mozilla/gecko/background/common/TestUtils.java]
 [src/org/mozilla/gecko/background/common/TestWaitHelper.java]
 [src/org/mozilla/gecko/background/db/TestAndroidBrowserBookmarksRepository.java]
-[src/org/mozilla/gecko/background/db/TestAndroidBrowserHistoryDataExtender.java]
 [src/org/mozilla/gecko/background/db/TestAndroidBrowserHistoryRepository.java]
 [src/org/mozilla/gecko/background/db/TestBookmarks.java]
-[src/org/mozilla/gecko/background/db/TestCachedSQLiteOpenHelper.java]
 [src/org/mozilla/gecko/background/db/TestClientsDatabase.java]
 [src/org/mozilla/gecko/background/db/TestClientsDatabaseAccessor.java]
 [src/org/mozilla/gecko/background/db/TestFennecTabsRepositorySession.java]
 [src/org/mozilla/gecko/background/db/TestFormHistoryRepositorySession.java]
 [src/org/mozilla/gecko/background/db/TestPasswordsRepository.java]
 [src/org/mozilla/gecko/background/fxa/TestBrowserIDKeyPairGeneration.java]
 [src/org/mozilla/gecko/background/fxa/authenticator/TestAccountPickler.java]
 [src/org/mozilla/gecko/background/nativecode/test/TestNativeCrypto.java]
deleted file mode 100644
--- a/mobile/android/tests/background/junit3/src/org/mozilla/gecko/background/db/TestAndroidBrowserHistoryDataExtender.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-package org.mozilla.gecko.background.db;
-
-import android.database.Cursor;
-
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.mozilla.gecko.background.helpers.AndroidSyncTestCase;
-import org.mozilla.gecko.background.sync.helpers.HistoryHelpers;
-import org.mozilla.gecko.sync.ExtendedJSONObject;
-import org.mozilla.gecko.sync.Utils;
-import org.mozilla.gecko.sync.repositories.NullCursorException;
-import org.mozilla.gecko.sync.repositories.android.AndroidBrowserHistoryDataExtender;
-import org.mozilla.gecko.sync.repositories.android.RepoUtils;
-import org.mozilla.gecko.sync.repositories.domain.HistoryRecord;
-
-import java.util.ArrayList;
-
-public class TestAndroidBrowserHistoryDataExtender extends AndroidSyncTestCase {
-
-  protected AndroidBrowserHistoryDataExtender extender;
-  protected static final String LOG_TAG = "SyncHistoryVisitsTest";
-
-  public void setUp() {
-    extender = new AndroidBrowserHistoryDataExtender(getApplicationContext());
-    extender.wipe();
-  }
-
-  public void tearDown() {
-    extender.close();
-  }
-
-  public void testStoreFetch() throws Exception {
-    String guid = Utils.generateGuid();
-    extender.store(Utils.generateGuid(), null);
-    extender.store(guid, null);
-    extender.store(Utils.generateGuid(), null);
-
-    Cursor cur = null;
-    try {
-      cur = extender.fetch(guid);
-      assertEquals(1, cur.getCount());
-      assertTrue(cur.moveToFirst());
-      assertEquals(guid, cur.getString(0));
-    } finally {
-      if (cur != null) {
-        cur.close();
-      }
-    }
-  }
-
-  public void testVisitsForGUID() throws Exception {
-    String guid = Utils.generateGuid();
-    JSONArray visits = new ExtendedJSONObject("{ \"visits\": [ { \"key\" : \"value\" } ] }").getArray("visits");
-
-    extender.store(Utils.generateGuid(), null);
-    extender.store(guid, visits);
-    extender.store(Utils.generateGuid(), null);
-
-    JSONArray fetchedVisits = extender.visitsForGUID(guid);
-    assertEquals(1, fetchedVisits.size());
-    assertEquals("value", ((JSONObject)fetchedVisits.get(0)).get("key"));
-  }
-
-  public void testDeleteHandlesBadGUIDs() {
-    String evilGUID = "' or '1'='1";
-    extender.store(Utils.generateGuid(), null);
-    extender.store(Utils.generateGuid(), null);
-    extender.store(evilGUID, null);
-    extender.delete(evilGUID);
-
-    Cursor cur = null;
-    try {
-      cur = extender.fetchAll();
-      assertEquals(cur.getCount(), 2);
-      assertTrue(cur.moveToFirst());
-      while (!cur.isAfterLast()) {
-        String guid = RepoUtils.getStringFromCursor(cur, AndroidBrowserHistoryDataExtender.COL_GUID);
-        assertFalse(evilGUID.equals(guid));
-        cur.moveToNext();
-      }
-    } catch (NullCursorException e) {
-      e.printStackTrace();
-      fail("Should not have null cursor.");
-    } finally {
-      if (cur != null) {
-        cur.close();
-      }
-    }
-  }
-
-  public void testStoreFetchHandlesBadGUIDs() {
-    String evilGUID = "' or '1'='1";
-    extender.store(Utils.generateGuid(), null);
-    extender.store(Utils.generateGuid(), null);
-    extender.store(evilGUID, null);
-
-    Cursor cur = null;
-    try {
-      cur = extender.fetch(evilGUID);
-      assertEquals(1, cur.getCount());
-      assertTrue(cur.moveToFirst());
-      while (!cur.isAfterLast()) {
-        String guid = RepoUtils.getStringFromCursor(cur, AndroidBrowserHistoryDataExtender.COL_GUID);
-        assertEquals(evilGUID, guid);
-        cur.moveToNext();
-      }
-    } catch (NullCursorException e) {
-      e.printStackTrace();
-      fail("Should not have null cursor.");
-    } finally {
-      if (cur != null) {
-        cur.close();
-      }
-    }
-  }
-
-  public void testBulkInsert() throws NullCursorException {
-    ArrayList<HistoryRecord> records = new ArrayList<HistoryRecord>();
-    records.add(HistoryHelpers.createHistory1());
-    records.add(HistoryHelpers.createHistory2());
-    extender.bulkInsert(records);
-
-    for (HistoryRecord record : records) {
-      HistoryRecord toCompare = (HistoryRecord) record.copyWithIDs(record.guid, record.androidID);
-      toCompare.visits = extender.visitsForGUID(record.guid);
-      assertEquals(record.visits.size(), toCompare.visits.size());
-      assertTrue(record.equals(toCompare));
-    }
-
-    // Now insert existing records, changing one, and add another record.
-    records.get(0).title = "test";
-    records.add(HistoryHelpers.createHistory3());
-    extender.bulkInsert(records);
-
-    for (HistoryRecord record : records) {
-      HistoryRecord toCompare = (HistoryRecord) record.copyWithIDs(record.guid, record.androidID);
-      toCompare.visits = extender.visitsForGUID(record.guid);
-      assertEquals(record.visits.size(), toCompare.visits.size());
-      assertTrue(record.equals(toCompare));
-    }
-  }
-}
--- a/mobile/android/tests/background/junit3/src/org/mozilla/gecko/background/db/TestAndroidBrowserHistoryRepository.java
+++ b/mobile/android/tests/background/junit3/src/org/mozilla/gecko/background/db/TestAndroidBrowserHistoryRepository.java
@@ -2,30 +2,27 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 package org.mozilla.gecko.background.db;
 
 import java.util.ArrayList;
 
 import org.json.simple.JSONObject;
 import org.mozilla.gecko.background.sync.helpers.ExpectFetchDelegate;
-import org.mozilla.gecko.background.sync.helpers.ExpectFinishDelegate;
 import org.mozilla.gecko.background.sync.helpers.HistoryHelpers;
 import org.mozilla.gecko.db.BrowserContract;
 import org.mozilla.gecko.sync.Utils;
-import org.mozilla.gecko.sync.repositories.InactiveSessionException;
 import org.mozilla.gecko.sync.repositories.NullCursorException;
 import org.mozilla.gecko.sync.repositories.Repository;
 import org.mozilla.gecko.sync.repositories.RepositorySession;
 import org.mozilla.gecko.sync.repositories.android.AndroidBrowserHistoryDataAccessor;
 import org.mozilla.gecko.sync.repositories.android.AndroidBrowserHistoryRepository;
 import org.mozilla.gecko.sync.repositories.android.AndroidBrowserHistoryRepositorySession;
 import org.mozilla.gecko.sync.repositories.android.AndroidBrowserRepository;
 import org.mozilla.gecko.sync.repositories.android.AndroidBrowserRepositoryDataAccessor;
-import org.mozilla.gecko.sync.repositories.android.AndroidBrowserRepositorySession;
 import org.mozilla.gecko.sync.repositories.android.BrowserContractHelpers;
 import org.mozilla.gecko.sync.repositories.android.RepoUtils;
 import org.mozilla.gecko.sync.repositories.delegates.RepositorySessionCreationDelegate;
 import org.mozilla.gecko.sync.repositories.domain.HistoryRecord;
 import org.mozilla.gecko.sync.repositories.domain.Record;
 
 import android.content.ContentValues;
 import android.content.Context;
@@ -57,24 +54,16 @@ public class TestAndroidBrowserHistoryRe
   }
 
   @Override
   protected AndroidBrowserRepositoryDataAccessor getDataAccessor() {
     return new AndroidBrowserHistoryDataAccessor(getApplicationContext());
   }
 
   @Override
-  protected void closeDataAccessor(AndroidBrowserRepositoryDataAccessor dataAccessor) {
-    if (!(dataAccessor instanceof AndroidBrowserHistoryDataAccessor)) {
-      throw new IllegalArgumentException("Only expecting a history data accessor.");
-    }
-    ((AndroidBrowserHistoryDataAccessor) dataAccessor).closeExtender();
-  }
-
-  @Override
   public void testFetchAll() {
     Record[] expected = new Record[2];
     expected[0] = HistoryHelpers.createHistory3();
     expected[1] = HistoryHelpers.createHistory2();
     basicFetchAllTest(expected);
   }
 
   /*
@@ -453,46 +442,9 @@ public class TestAndroidBrowserHistoryRe
     records.add(HistoryHelpers.createHistory1());
     records.add(HistoryHelpers.createHistory2());
     records.add(HistoryHelpers.createHistory3());
     db.bulkInsert(records);
 
     performWait(fetchAllRunnable(session, preparedExpectFetchDelegate(records.toArray(new Record[records.size()]))));
     session.abort();
   }
-
-  public void testDataExtenderIsClosedBeforeBegin() {
-    // Create a session but don't begin() it.
-    final AndroidBrowserRepositorySession session = (AndroidBrowserRepositorySession) createSession();
-    AndroidBrowserHistoryDataAccessor db = (AndroidBrowserHistoryDataAccessor) session.getDBHelper();
-
-    // Confirm dataExtender is closed before beginning session.
-    assertTrue(db.getHistoryDataExtender().isClosed());
-  }
-
-  public void testDataExtenderIsClosedAfterFinish() throws InactiveSessionException {
-    final AndroidBrowserHistoryRepositorySession session = (AndroidBrowserHistoryRepositorySession) createAndBeginSession();
-    AndroidBrowserHistoryDataAccessor db = (AndroidBrowserHistoryDataAccessor) session.getDBHelper();
-
-    // Perform an action that opens the dataExtender.
-    HistoryRecord h1 = HistoryHelpers.createHistory1();
-    db.insert(h1);
-    assertFalse(db.getHistoryDataExtender().isClosed());
-
-    // Check dataExtender is closed upon finish.
-    performWait(finishRunnable(session, new ExpectFinishDelegate()));
-    assertTrue(db.getHistoryDataExtender().isClosed());
-  }
-
-  public void testDataExtenderIsClosedAfterAbort() throws InactiveSessionException {
-    final AndroidBrowserHistoryRepositorySession session = (AndroidBrowserHistoryRepositorySession) createAndBeginSession();
-    AndroidBrowserHistoryDataAccessor db = (AndroidBrowserHistoryDataAccessor) session.getDBHelper();
-
-    // Perform an action that opens the dataExtender.
-    HistoryRecord h1 = HistoryHelpers.createHistory1();
-    db.insert(h1);
-    assertFalse(db.getHistoryDataExtender().isClosed());
-
-    // Check dataExtender is closed upon abort.
-    session.abort();
-    assertTrue(db.getHistoryDataExtender().isClosed());
-  }
 }
deleted file mode 100644
--- a/mobile/android/tests/background/junit3/src/org/mozilla/gecko/background/db/TestCachedSQLiteOpenHelper.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-package org.mozilla.gecko.background.db;
-
-import org.mozilla.gecko.background.sync.helpers.HistoryHelpers;
-import org.mozilla.gecko.sync.repositories.NullCursorException;
-import org.mozilla.gecko.sync.repositories.android.AndroidBrowserHistoryDataExtender;
-import org.mozilla.gecko.sync.repositories.android.ClientsDatabase;
-import org.mozilla.gecko.sync.repositories.domain.ClientRecord;
-import org.mozilla.gecko.sync.repositories.domain.HistoryRecord;
-import org.mozilla.gecko.sync.setup.Constants;
-
-import android.database.Cursor;
-import android.test.AndroidTestCase;
-
-public class TestCachedSQLiteOpenHelper extends AndroidTestCase {
-
-  protected ClientsDatabase clientsDB;
-  protected AndroidBrowserHistoryDataExtender extender;
-
-  public void setUp() {
-    clientsDB = new ClientsDatabase(mContext);
-    extender = new AndroidBrowserHistoryDataExtender(mContext);
-  }
-
-  public void tearDown() {
-    clientsDB.close();
-    extender.close();
-  }
-
-  public void testUnclosedDatabasesDontInteract() throws NullCursorException {
-    // clientsDB gracefully does its thing and closes.
-    clientsDB.wipeClientsTable();
-    ClientRecord record = new ClientRecord();
-    String profileConst = Constants.DEFAULT_PROFILE;
-    clientsDB.store(profileConst, record);
-    clientsDB.close();
-
-    // extender does its thing but still hasn't closed.
-    HistoryRecord h = HistoryHelpers.createHistory1();
-    extender.store(h.guid, h.visits);
-
-    // Ensure items in the clientsDB are still accessible nonetheless.
-    Cursor cur = null;
-    try {
-      cur = clientsDB.fetchAllClients();
-      assertTrue(cur.moveToFirst());
-      assertEquals(1, cur.getCount());
-    } finally {
-      if (cur != null) {
-        cur.close();
-      }
-    }
-  }
-}