Bug 1291821 - Post: remove unused files r=rnewman
authorGrisha Kruglov <gkruglov@mozilla.com>
Tue, 29 Nov 2016 13:36:26 -0800
changeset 373905 bd232d46a3967a174a399d4cf444b99391bd8014
parent 373904 5e0b1684de40494b4464d963253149080b120fa8
child 373906 14fd552c865b6492e84a8a71ede89e534c529b10
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1291821
milestone54.0a1
Bug 1291821 - Post: remove unused files r=rnewman MozReview-Commit-ID: 4qM5vx4AQyQ
mobile/android/base/android-services.mozbuild
mobile/android/services/src/main/java/org/mozilla/gecko/sync/Sync11Configuration.java
mobile/android/tests/background/junit4/src/org/mozilla/android/sync/test/TestSyncConfiguration.java
--- a/mobile/android/base/android-services.mozbuild
+++ b/mobile/android/base/android-services.mozbuild
@@ -1057,17 +1057,16 @@ sync_java_files = [TOPSRCDIR + '/mobile/
     'sync/stage/FetchMetaGlobalStage.java',
     'sync/stage/FormHistoryServerSyncStage.java',
     'sync/stage/GlobalSyncStage.java',
     'sync/stage/NoSuchStageException.java',
     'sync/stage/PasswordsServerSyncStage.java',
     'sync/stage/ServerSyncStage.java',
     'sync/stage/SyncClientsEngineStage.java',
     'sync/stage/UploadMetaGlobalStage.java',
-    'sync/Sync11Configuration.java',
     'sync/SyncConfiguration.java',
     'sync/SyncConfigurationException.java',
     'sync/SyncConstants.java',
     'sync/SyncDeadlineReachedException.java',
     'sync/SyncException.java',
     'sync/synchronizer/ConcurrentRecordConsumer.java',
     'sync/synchronizer/RecordConsumer.java',
     'sync/synchronizer/RecordsChannel.java',
deleted file mode 100644
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/sync/Sync11Configuration.java
+++ /dev/null
@@ -1,84 +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;
-
-import java.net.URI;
-
-import org.mozilla.gecko.background.common.log.Logger;
-import org.mozilla.gecko.sync.crypto.KeyBundle;
-import org.mozilla.gecko.sync.net.AuthHeaderProvider;
-
-import android.content.SharedPreferences;
-import android.content.SharedPreferences.Editor;
-
-/**
- * Override SyncConfiguration to restore the old behavior of clusterURL --
- * that is, a URL without the protocol version etc.
- *
- */
-public class Sync11Configuration extends SyncConfiguration {
-  private static final String LOG_TAG = "Sync11Configuration";
-  private static final String API_VERSION = "1.1";
-
-  public Sync11Configuration(String username,
-                             AuthHeaderProvider authHeaderProvider,
-                             SharedPreferences prefs) {
-    super(username, authHeaderProvider, prefs);
-  }
-
-  public Sync11Configuration(String username,
-                             AuthHeaderProvider authHeaderProvider,
-                             SharedPreferences prefs,
-                             KeyBundle keyBundle) {
-    super(username, authHeaderProvider, prefs, keyBundle);
-  }
-
-  @Override
-  public String getAPIVersion() {
-    return API_VERSION;
-  }
-
-  @Override
-  public String storageURL() {
-    return clusterURL + API_VERSION + "/" + username + "/storage";
-  }
-
-  @Override
-  protected String infoBaseURL() {
-    return clusterURL + API_VERSION + "/" + username + "/info/";
-  }
-
-  protected void setAndPersistClusterURL(URI u, SharedPreferences prefs) {
-    boolean shouldPersist = (prefs != null) && (clusterURL == null);
-
-    Logger.trace(LOG_TAG, "Setting cluster URL to " + u.toASCIIString() +
-                          (shouldPersist ? ". Persisting." : ". Not persisting."));
-    clusterURL = u;
-    if (shouldPersist) {
-      Editor edit = prefs.edit();
-      edit.putString(PREF_CLUSTER_URL, clusterURL.toASCIIString());
-      edit.commit();
-    }
-  }
-
-  protected void setClusterURL(URI u, SharedPreferences prefs) {
-    if (u == null) {
-      Logger.warn(LOG_TAG, "Refusing to set cluster URL to null.");
-      return;
-    }
-    URI uri = u.normalize();
-    if (uri.toASCIIString().endsWith("/")) {
-      setAndPersistClusterURL(u, prefs);
-      return;
-    }
-    setAndPersistClusterURL(uri.resolve("/"), prefs);
-    Logger.trace(LOG_TAG, "Set cluster URL to " + clusterURL.toASCIIString() + ", given input " + u.toASCIIString());
-  }
-
-  @Override
-  public void setClusterURL(URI u) {
-    setClusterURL(u, this.getPrefs());
-  }
-}
\ No newline at end of file
deleted file mode 100644
--- a/mobile/android/tests/background/junit4/src/org/mozilla/android/sync/test/TestSyncConfiguration.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-package org.mozilla.android.sync.test;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mozilla.gecko.background.testhelpers.MockSharedPreferences;
-import org.mozilla.gecko.background.testhelpers.TestRunner;
-import org.mozilla.gecko.sync.Sync11Configuration;
-import org.mozilla.gecko.sync.SyncConfiguration;
-
-import java.net.URI;
-
-@RunWith(TestRunner.class)
-public class TestSyncConfiguration {
-  @Test
-  public void testURLs() throws Exception {
-    final MockSharedPreferences prefs = new MockSharedPreferences();
-
-    // N.B., the username isn't used in the cluster path.
-    SyncConfiguration fxaConfig = new SyncConfiguration("username", null, prefs);
-    fxaConfig.clusterURL = new URI("http://db1.oldsync.dev.lcip.org/1.1/174");
-    Assert.assertEquals("http://db1.oldsync.dev.lcip.org/1.1/174/info/collections", fxaConfig.infoCollectionsURL());
-    Assert.assertEquals("http://db1.oldsync.dev.lcip.org/1.1/174/info/collection_counts", fxaConfig.infoCollectionCountsURL());
-    Assert.assertEquals("http://db1.oldsync.dev.lcip.org/1.1/174/storage/meta/global", fxaConfig.metaURL());
-    Assert.assertEquals("http://db1.oldsync.dev.lcip.org/1.1/174/storage", fxaConfig.storageURL());
-    Assert.assertEquals("http://db1.oldsync.dev.lcip.org/1.1/174/storage/collection", fxaConfig.collectionURI("collection").toASCIIString());
-
-    SyncConfiguration oldConfig = new Sync11Configuration("username", null, prefs);
-    oldConfig.clusterURL = new URI("https://db.com/internal/");
-    Assert.assertEquals("https://db.com/internal/1.1/username/info/collections", oldConfig.infoCollectionsURL());
-    Assert.assertEquals("https://db.com/internal/1.1/username/info/collection_counts", oldConfig.infoCollectionCountsURL());
-    Assert.assertEquals("https://db.com/internal/1.1/username/storage/meta/global", oldConfig.metaURL());
-    Assert.assertEquals("https://db.com/internal/1.1/username/storage", oldConfig.storageURL());
-    Assert.assertEquals("https://db.com/internal/1.1/username/storage/collection", oldConfig.collectionURI("collection").toASCIIString());
-  }
-}