Bug 1688040 - part6: Added chrome global as a BindingAlias of the browser global. r=baku

Differential Revision: https://phabricator.services.mozilla.com/D103351
This commit is contained in:
Luca Greco 2021-10-06 12:28:20 +00:00
Родитель a73062e1f9
Коммит 656e8251e8
2 изменённых файлов: 6 добавлений и 2 удалений

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

@ -16,7 +16,7 @@
[Exposed=(ServiceWorker)]
interface mixin ExtensionGlobalsMixin {
[Replaceable, SameObject, BinaryName="AcquireExtensionBrowser",
Func="extensions::ExtensionAPIAllowed"]
BindingAlias="chrome", Func="extensions::ExtensionAPIAllowed"]
readonly attribute ExtensionBrowser browser;
};

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

@ -24,11 +24,13 @@ add_task(async function setup() {
add_task(async function test_ext_context_does_have_webidl_bindings() {
await runExtensionAPITest("should have a browser global object", {
backgroundScript() {
const { browser } = self;
const { browser, chrome } = self;
return {
hasExtensionAPI: !!browser,
hasExtensionMockAPI: !!browser?.mockExtensionAPI,
hasChromeCompatGlobal: !!chrome,
hasChromeMockAPI: !!chrome?.mockExtensionAPI,
};
},
assertResults({ testResult, testError }) {
@ -38,6 +40,8 @@ add_task(async function test_ext_context_does_have_webidl_bindings() {
{
hasExtensionAPI: true,
hasExtensionMockAPI: true,
hasChromeCompatGlobal: true,
hasChromeMockAPI: true,
},
"browser and browser.test WebIDL API bindings found"
);