mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1216207 - Modify navigator.hasFeature method to implement new
late-customization feature detection and change the test as well r=ehsan
This commit is contained in:
parent
9d6ee8543d
commit
181a49041d
@ -1607,9 +1607,10 @@ Navigator::HasFeature(const nsAString& aName, ErrorResult& aRv)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Hardcoded web-extensions feature which is b2g specific.
|
||||
// Hardcoded extensions features which are b2g specific.
|
||||
#ifdef MOZ_B2G
|
||||
if (aName.EqualsLiteral("web-extensions")) {
|
||||
if (aName.EqualsLiteral("web-extensions") ||
|
||||
aName.EqualsLiteral("late-customization")) {
|
||||
p->MaybeResolve(true);
|
||||
return p.forget();
|
||||
}
|
||||
|
@ -65,11 +65,19 @@ function testExtensions() {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return navigator.hasFeature("web-extensions").then(function(value) {
|
||||
is(value, true, "Resolve the Promise with " + value + " for web-extensions");
|
||||
}, function() {
|
||||
ok(false, "The Promise should not be rejected");
|
||||
var builtInFeatures = [
|
||||
{feature: "web-extensions", value: true},
|
||||
{feature: "late-customization", value: true}
|
||||
];
|
||||
|
||||
builtInFeatures.forEach(function(x) {
|
||||
navigator.hasFeature(x.feature).then(function(value) {
|
||||
is(value, x.value, "Resolve the Promise with " + value + " for feature: " + x.feature);
|
||||
}).catch(function(ex) {
|
||||
ok(false, "The Promise should not be rejected");
|
||||
});
|
||||
});
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
SpecialPowers.pushPermissions([
|
||||
|
Loading…
Reference in New Issue
Block a user