nits -- fold down draft
authorNick Alexander <nalexander@mozilla.com>
Thu, 25 Feb 2016 11:55:53 -0800
changeset 334707 601a08a1b52a792c0b02ac0126758b6c512d37af
parent 334706 294f0f6b545e15f3bcef5343342f9e39c5ada0b1
child 514974 1189c3e39f2e7cfcfe8215a4e8564fd3f89fb283
push id11614
push usernalexander@mozilla.com
push dateThu, 25 Feb 2016 22:06:17 +0000
milestone47.0a1
nits -- fold down MozReview-Commit-ID: FqhRWLeFNMm
mobile/android/app/mobile.js
mobile/android/services/src/main/java/org/mozilla/gecko/push/autopush/AutopushClientException.java
mobile/android/tests/background/junit4/src/org/mozilla/gecko/push/autopush/test/TestLiveAutopushClient.java
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -986,17 +986,17 @@ pref("browser.tabs.showAudioPlayingIcon"
 pref("dom.serviceWorkers.enabled", true);
 pref("dom.serviceWorkers.interception.enabled", true);
 
 // Enable DOM push API in Nightly Fennec.
 #ifdef NIGHTLY_BUILD
 pref("dom.push.enabled", true);
 pref("dom.push.debug", true);
 pref("dom.push.loglevel", "debug");
-pref("dom.push.serverURL", "https://updates-autopush-dev.stage.mozaws.net/v1/gcm/829133274407");
+pref("dom.push.serverURL", "https://updates-autopush.stage.mozaws.net/v1/gcm/829133274407");
 #endif
 
 // The remote content URL where FxAccountsWebChannel messages originate.  Must use HTTPS.
 pref("identity.fxaccounts.remote.webchannel.uri", "https://accounts.firefox.com");
 
 // The remote URL of the Firefox Account profile server.
 pref("identity.fxaccounts.remote.profile.uri", "https://profile.accounts.firefox.com/v1");
 
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/push/autopush/AutopushClientException.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/push/autopush/AutopushClientException.java
@@ -56,16 +56,20 @@ public class AutopushClientException ext
         public boolean isInvalidAuthentication() {
             return httpStatusCode == HttpStatus.SC_UNAUTHORIZED;
         }
 
         public boolean isNotFound() {
             return httpStatusCode == HttpStatus.SC_NOT_FOUND;
         }
 
+        public boolean isGone() {
+            return httpStatusCode == HttpStatus.SC_GONE;
+        }
+
         @Override
         public boolean isTransientError() {
             return httpStatusCode >= 500;
         }
     }
 
     public static class AutopushClientMalformedResponseException extends AutopushClientRemoteException {
         private static final long serialVersionUID = 2209313149952001909L;
--- a/mobile/android/tests/background/junit4/src/org/mozilla/gecko/push/autopush/test/TestLiveAutopushClient.java
+++ b/mobile/android/tests/background/junit4/src/org/mozilla/gecko/push/autopush/test/TestLiveAutopushClient.java
@@ -30,17 +30,17 @@ import static org.mockito.Mockito.verify
 /**
  * This test straddles an awkward line: it uses Mockito, but doesn't actually mock the service
  * endpoint.  That's why it's a <b>live</b> test: most of its value is checking that the client
  * implementation and the upstream server implementation are corresponding correctly.
  */
 @RunWith(TestRunner.class)
 // @Ignore("Live test that requires network connection -- remove this line to run this test.")
 public class TestLiveAutopushClient {
-    final String serverURL = "https://updates-autopush-dev.stage.mozaws.net/v1/gcm/829133274407";
+    final String serverURL = "https://updates-autopush.stage.mozaws.net/v1/gcm/829133274407";
 
     protected AutopushClient client;
 
     @Before
     public void setUp() throws Exception {
         BaseResource.rewriteLocalhost = false;
         client = new AutopushClient(serverURL, Utils.newSynchronousExecutor());
     }
@@ -88,17 +88,17 @@ public class TestLiveAutopushClient {
         Assert.assertNull(assertSuccess(unregisterDelegate, Void.class));
 
         // Trying to unregister a second time should give a 404.
         final RequestDelegate<Void> reunregisterDelegate = mock(RequestDelegate.class);
         client.unregisterUserAgent(registerResponse.uaid, registerResponse.secret, reunregisterDelegate);
 
         final AutopushClientException failureException = assertFailure(reunregisterDelegate, Void.class);
         Assert.assertThat(failureException, instanceOf(AutopushClientException.AutopushClientRemoteException.class));
-        Assert.assertTrue(((AutopushClientException.AutopushClientRemoteException) failureException).isNotFound());
+        Assert.assertTrue(((AutopushClientException.AutopushClientRemoteException) failureException).isGone());
     }
 
     @Test
     public void testChannel() throws Exception {
         final RequestDelegate<RegisterUserAgentResponse> registerDelegate = mock(RequestDelegate.class);
         client.registerUserAgent(Utils.generateGuid(), registerDelegate);
 
         final RegisterUserAgentResponse registerResponse = assertSuccess(registerDelegate, RegisterUserAgentResponse.class);
@@ -117,23 +117,23 @@ public class TestLiveAutopushClient {
         Assert.assertThat(subscribeResponse.endpoint, startsWith(FxAccountUtils.getAudienceForURL(serverURL)));
 
         // And we should be able to unsubscribe.
         final RequestDelegate<Void> unsubscribeDelegate = mock(RequestDelegate.class);
         client.unsubscribeChannel(registerResponse.uaid, registerResponse.secret, subscribeResponse.channelID, unsubscribeDelegate);
 
         Assert.assertNull(assertSuccess(unsubscribeDelegate, Void.class));
 
-        // Trying to unsubscribe a second time should give a 404.
+        // Trying to unsubscribe a second time should give a 410.
         final RequestDelegate<Void> reunsubscribeDelegate = mock(RequestDelegate.class);
         client.unsubscribeChannel(registerResponse.uaid, registerResponse.secret, subscribeResponse.channelID, reunsubscribeDelegate);
 
         final AutopushClientException reunsubscribeFailureException = assertFailure(reunsubscribeDelegate, Void.class);
         Assert.assertThat(reunsubscribeFailureException, instanceOf(AutopushClientException.AutopushClientRemoteException.class));
-        Assert.assertTrue(((AutopushClientException.AutopushClientRemoteException) reunsubscribeFailureException).isNotFound());
+        Assert.assertTrue(((AutopushClientException.AutopushClientRemoteException) reunsubscribeFailureException).isGone());
 
         // Trying to unsubscribe from a non-existent channel should give a 404.  Right now it gives a 401!
         final RequestDelegate<Void> badUnsubscribeDelegate = mock(RequestDelegate.class);
         client.unsubscribeChannel(registerResponse.uaid + "BAD", registerResponse.secret, subscribeResponse.channelID, badUnsubscribeDelegate);
 
         final AutopushClientException badUnsubscribeFailureException = assertFailure(badUnsubscribeDelegate, Void.class);
         Assert.assertThat(badUnsubscribeFailureException, instanceOf(AutopushClientException.AutopushClientRemoteException.class));
         Assert.assertTrue(((AutopushClientException.AutopushClientRemoteException) badUnsubscribeFailureException).isInvalidAuthentication());