From 0e3148f0da5b5c062d7986b5937639c8e38045fa Mon Sep 17 00:00:00 2001 From: isabelrios Date: Fri, 4 Oct 2019 12:41:36 +0200 Subject: [PATCH] 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 871a0fefb..412c5a9ee 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 dcb4cf13f..3e0f633af 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 23ab2269b..9161aaff0 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 01e0acc4d..b1262b5b2 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)