From c534f17571632ed8efc9478a62f947d405388f0a Mon Sep 17 00:00:00 2001 From: Noemi Erli Date: Tue, 18 Feb 2020 08:39:30 +0200 Subject: [PATCH] Backed out changeset fa5ee85e20a5 (bug 1603673) for causing lint failure in GeckoRuntimeSettings.java CLOSED TREE --- dom/manifest/ManifestObtainer.jsm | 5 --- .../browser_ManifestIcons_browserFetchIcon.js | 3 -- .../browser_ManifestObtainer_credentials.js | 3 -- .../test/browser_ManifestObtainer_obtain.js | 2 - .../geckoview/test/ContentDelegateTest.kt | 22 ---------- .../geckoview/GeckoRuntimeSettings.java | 41 ------------------- 6 files changed, 76 deletions(-) diff --git a/dom/manifest/ManifestObtainer.jsm b/dom/manifest/ManifestObtainer.jsm index 69152081a280..26cc974ff245 100644 --- a/dom/manifest/ManifestObtainer.jsm +++ b/dom/manifest/ManifestObtainer.jsm @@ -25,8 +25,6 @@ */ "use strict"; -const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); - const { PromiseMessage } = ChromeUtils.import( "resource://gre/modules/PromiseMessage.jsm" ); @@ -74,9 +72,6 @@ var ManifestObtainer = { aContent, aOptions = { checkConformance: false } ) { - if (!Services.prefs.getBoolPref("dom.manifest.enabled")) { - throw new Error("Obtaining manifest is disabled by pref."); - } if (!aContent || isXULBrowser(aContent)) { const err = new TypeError("Invalid input. Expected a DOM Window."); return Promise.reject(err); diff --git a/dom/manifest/test/browser_ManifestIcons_browserFetchIcon.js b/dom/manifest/test/browser_ManifestIcons_browserFetchIcon.js index 8b2a1b9066be..7997891b8629 100644 --- a/dom/manifest/test/browser_ManifestIcons_browserFetchIcon.js +++ b/dom/manifest/test/browser_ManifestIcons_browserFetchIcon.js @@ -1,9 +1,6 @@ // Used by JSHint: /* global Cu, BrowserTestUtils, ok, add_task, gBrowser */ "use strict"; - -Services.prefs.setBoolPref("dom.manifest.enabled", true); - const { ManifestIcons } = ChromeUtils.import( "resource://gre/modules/ManifestIcons.jsm" ); diff --git a/dom/manifest/test/browser_ManifestObtainer_credentials.js b/dom/manifest/test/browser_ManifestObtainer_credentials.js index 0203ab605f4f..3de250cf144f 100644 --- a/dom/manifest/test/browser_ManifestObtainer_credentials.js +++ b/dom/manifest/test/browser_ManifestObtainer_credentials.js @@ -1,9 +1,6 @@ // Used by JSHint: /* global ok, is, Cu, BrowserTestUtils, add_task, gBrowser, makeTestURL, requestLongerTimeout*/ "use strict"; - -Services.prefs.setBoolPref("dom.manifest.enabled", true); - const { ManifestObtainer } = ChromeUtils.import( "resource://gre/modules/ManifestObtainer.jsm" ); diff --git a/dom/manifest/test/browser_ManifestObtainer_obtain.js b/dom/manifest/test/browser_ManifestObtainer_obtain.js index 779e60f8b658..676bc48f645c 100644 --- a/dom/manifest/test/browser_ManifestObtainer_obtain.js +++ b/dom/manifest/test/browser_ManifestObtainer_obtain.js @@ -2,8 +2,6 @@ /* global ok, is, Cu, BrowserTestUtils, add_task, gBrowser, requestLongerTimeout*/ "use strict"; -Services.prefs.setBoolPref("dom.manifest.enabled", true); - const { ManifestObtainer } = ChromeUtils.import( "resource://gre/modules/ManifestObtainer.jsm" ); diff --git a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/ContentDelegateTest.kt b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/ContentDelegateTest.kt index b6bb72d4598a..ce7c78d32ca5 100644 --- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/ContentDelegateTest.kt +++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/ContentDelegateTest.kt @@ -296,28 +296,6 @@ class ContentDelegateTest : BaseSessionTest() { }) } - @Test fun webAppManifestPref() { - val initialState = sessionRule.runtime.settings.getWebManifestEnabled() - val jsToRun = "document.querySelector('link[rel=manifest]').relList.supports('manifest');" - - // Check pref'ed off - sessionRule.runtime.settings.setWebManifestEnabled(false) - mainSession.loadTestPath(HELLO_HTML_PATH) - mainSession.waitForPageStop() - var result = equalTo(mainSession.evaluateJS(jsToRun) as Boolean) - - assertThat("Disabling pref makes relList.supports('manifest') return false", false, result) - - // Check pref'ed on - sessionRule.runtime.settings.setWebManifestEnabled(true) - mainSession.loadTestPath(HELLO_HTML_PATH) - mainSession.waitForPageStop() - result = equalTo(mainSession.evaluateJS(jsToRun) as Boolean) - assertThat("Enabling pref makes relList.supports('manifest') return true", true, result) - - sessionRule.runtime.settings.setWebManifestEnabled(initialState) - } - @Test fun webAppManifest() { mainSession.loadTestPath(HELLO_HTML_PATH) mainSession.waitUntilCalled(object : Callbacks.All { diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java index e014135ee5b6..e07463e74dab 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java @@ -156,22 +156,6 @@ public final class GeckoRuntimeSettings extends RuntimeSettings { return this; } - /** - * Set whether web manifest support is enabled. - * - * This controls if Gecko actually downloads, or "obtains", web - * manifests and processes them. Without setting this pref, trying - * to obtain a manifest throws. - * - * @param enabled A flag determining whether Web Manifest processing support is - * enabled. - * @return The builder instance. - */ - public @NonNull Builder webManifest(final boolean enabled) { - getSettings().mWebManifest.set(enabled); - return this; - } - /** * Set whether or not web console messages should go to logcat. * @@ -458,8 +442,6 @@ public final class GeckoRuntimeSettings extends RuntimeSettings { return mContentBlocking; } - /* package */ final Pref mWebManifest = new Pref( - "dom.manifest.enabled", true); /* package */ final Pref mJavaScript = new Pref( "javascript.enabled", true); /* package */ final Pref mRemoteDebugging = new Pref( @@ -803,29 +785,6 @@ public final class GeckoRuntimeSettings extends RuntimeSettings { return out.toString(); } - /** - * Sets whether Web Manifest processing support is enabled. - * - * @param enabled A flag determining whether Web Manifest processing support is - * enabled. - * - * @return This GeckoRuntimeSettings instance. - */ - public @NonNull GeckoRuntimeSettings setWebManifestEnabled(final boolean enabled) { - mWebManifest.commit(enabled); - return this; - } - - /** - * Get whether or not Web Manifest processing support is enabled. - * It defaults to true - but check mWebManifest to be sure! - * - * @return True if web manifest processing support is enabled. - */ - public boolean getWebManifestEnabled() { - return mWebManifest.get(); - } - /** * Set whether or not web console messages should go to logcat. *