зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
a73062e1f9
Коммит
656e8251e8
|
@ -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"
|
||||
);
|
||||
|
|
Загрузка…
Ссылка в новой задаче