From 785c89743a0dd7113528e2054e29b91a6763c410 Mon Sep 17 00:00:00 2001 From: isabelrios Date: Fri, 4 Oct 2019 12:41:36 +0200 Subject: [PATCH] [fenix] fixing more reviewers comments --- .../java/org/mozilla/fenix/components/FxaServer.kt | 8 ++++++++ .../mozilla/fenix/syncintegration/SyncIntegrationTest.kt | 4 ++-- .../main/java/org/mozilla/fenix/components/FxaServer.kt | 7 +++++++ .../mozilla/fenix/components/BackgroundServicesTest.kt | 4 ++-- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/app/src/androidTest/java/org/mozilla/fenix/components/FxaServer.kt b/app/src/androidTest/java/org/mozilla/fenix/components/FxaServer.kt index 871a0fefbe..412c5a9ee1 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/components/FxaServer.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/components/FxaServer.kt @@ -1,8 +1,16 @@ +/* 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.fenix.components import android.content.Context import mozilla.components.service.fxa.ServerConfig +/** + * Utility to configure Firefox Account stage servers. + */ + object FxaServer { const val CLIENT_ID = "a2270f727f45f648" const val REDIRECT_URL = "https://accounts.stage.mozaws.net/oauth/success/$CLIENT_ID" diff --git a/app/src/androidTest/java/org/mozilla/fenix/syncintegration/SyncIntegrationTest.kt b/app/src/androidTest/java/org/mozilla/fenix/syncintegration/SyncIntegrationTest.kt index dcb4cf13fa..3e0f633af6 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/syncintegration/SyncIntegrationTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/syncintegration/SyncIntegrationTest.kt @@ -108,7 +108,7 @@ class SyncIntegrationTest { passwordInput.setText(passwordValue) } - fun tapOnSygIn() { + fun tapOnSignIn() { mDevice.wait(Until.findObjects(By.text("Sign in")), TestAssetHelper.waitingTime) // Let's tap on enter, sometimes depending on the device the sign in button is // hidden by the keyboard @@ -159,7 +159,7 @@ class SyncIntegrationTest { tapOnContinueButton() typePassowrd() sleep(TestAssetHelper.waitingTime) - tapOnSygIn() + tapOnSignIn() } } diff --git a/app/src/main/java/org/mozilla/fenix/components/FxaServer.kt b/app/src/main/java/org/mozilla/fenix/components/FxaServer.kt index 23ab2269bc..9161aaff00 100644 --- a/app/src/main/java/org/mozilla/fenix/components/FxaServer.kt +++ b/app/src/main/java/org/mozilla/fenix/components/FxaServer.kt @@ -1,3 +1,6 @@ +/* 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.fenix.components import android.content.Context @@ -5,6 +8,10 @@ import mozilla.components.service.fxa.ServerConfig import org.mozilla.fenix.Experiments import org.mozilla.fenix.isInExperiment +/** + * Utility to configure Firefox Account servers. + */ + object FxaServer { const val CLIENT_ID = "a2270f727f45f648" const val REDIRECT_URL = "https://accounts.firefox.com/oauth/success/$CLIENT_ID" diff --git a/app/src/test/java/org/mozilla/fenix/components/BackgroundServicesTest.kt b/app/src/test/java/org/mozilla/fenix/components/BackgroundServicesTest.kt index 01e0acc4db..b1262b5b27 100644 --- a/app/src/test/java/org/mozilla/fenix/components/BackgroundServicesTest.kt +++ b/app/src/test/java/org/mozilla/fenix/components/BackgroundServicesTest.kt @@ -50,10 +50,10 @@ class BackgroundServicesTest { val context = mockk(relaxed = true) every { context.isInExperiment(eq(Experiments.asFeatureWebChannelsDisabled)) } returns false - // assertEquals("urn:ietf:wg:oauth:2.0:oob:oauth-redirect-webchannel", BackgroundServices.redirectUrl(context)) + assertEquals("urn:ietf:wg:oauth:2.0:oob:oauth-redirect-webchannel", FxaServer.redirectUrl(context)) every { context.isInExperiment(eq(Experiments.asFeatureWebChannelsDisabled)) } returns true - // assertEquals("https://accounts.firefox.com/oauth/success/a2270f727f45f648", BackgroundServices.redirectUrl(context)) + assertEquals("https://accounts.firefox.com/oauth/success/a2270f727f45f648", FxaServer.redirectUrl(context)) every { context.isInExperiment(eq(Experiments.asFeatureSyncDisabled)) } returns false var backgroundServices = TestableBackgroundServices(context)