Backed out changeset fa5ee85e20a5 (bug 1603673) for causing lint failure in GeckoRuntimeSettings.java CLOSED TREE

This commit is contained in:
Noemi Erli 2020-02-18 08:39:30 +02:00
Родитель ccfa51c524
Коммит c534f17571
6 изменённых файлов: 0 добавлений и 76 удалений

Просмотреть файл

@ -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);

Просмотреть файл

@ -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"
);

Просмотреть файл

@ -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"
);

Просмотреть файл

@ -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"
);

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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<Boolean> mWebManifest = new Pref<Boolean>(
"dom.manifest.enabled", true);
/* package */ final Pref<Boolean> mJavaScript = new Pref<Boolean>(
"javascript.enabled", true);
/* package */ final Pref<Boolean> mRemoteDebugging = new Pref<Boolean>(
@ -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.
*