Bug 1637803 - Expose WebExtension.isBuiltIn. r=owlish,droeh

Differential Revision: https://phabricator.services.mozilla.com/D75227
This commit is contained in:
Agi Sferro 2020-05-14 17:48:25 +00:00
Родитель 54398caee4
Коммит 1b07d9e24b
4 изменённых файлов: 10 добавлений и 5 удалений

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

@ -1439,6 +1439,7 @@ package org.mozilla.geckoview {
method @UiThread public void setTabDelegate(@Nullable WebExtension.TabDelegate);
field public final long flags;
field @NonNull public final String id;
field public final boolean isBuiltIn;
field @NonNull public final String location;
field @Nullable public final WebExtension.MetaData metaData;
}

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

@ -73,6 +73,8 @@ class WebExtensionTest : BaseSessionTest() {
"resource://android/assets/web_extensions/borderify/"
))
assertTrue(borderify.isBuiltIn)
mainSession.reload()
sessionRule.waitForPageStop()
@ -186,8 +188,7 @@ class WebExtensionTest : BaseSessionTest() {
"Adds a red border to all webpages matching example.com.")
assertEquals(extension.metaData!!.name, "Borderify")
assertEquals(extension.metaData!!.version, "1.0")
// TODO: Bug 1601067
// assertEquals(extension.isBuiltIn, false)
assertEquals(extension.isBuiltIn, false)
assertEquals(extension.metaData!!.enabled, false)
assertEquals(extension.metaData!!.signedState,
WebExtension.SignedStateFlags.SIGNED)

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

@ -58,8 +58,11 @@ public class WebExtension {
// TODO: move to @NonNull when we remove registerWebExtension
public final @Nullable MetaData metaData;
// TODO: make public
final boolean isBuiltIn;
/**
* Whether this extension is built-in. Built-in extension can be installed
* using {@link WebExtensionController#installBuiltIn}.
*/
public final boolean isBuiltIn;
/** Called whenever a delegate is set or unset on this {@link WebExtension} instance.
/* package */ interface DelegateController {

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

@ -688,4 +688,4 @@ exclude: true
[65.24]: {{javadoc_uri}}/CrashReporter.html#sendCrashReport-android.content.Context-android.os.Bundle-java.lang.String-
[65.25]: {{javadoc_uri}}/GeckoResult.html
[api-version]: eb4c8f11b68ce54cf780c4f08cde5f7d2a048093
[api-version]: 901bd3fab4e89390ffe1d0487f7156b687aec71a