Bug 811635 - Part 6: DOM API test. r=mrbkap, r=bz

This commit is contained in:
Henry Chang 2014-01-27 11:22:15 +08:00
parent c87ecb6359
commit f9681366c1

View File

@ -686,6 +686,12 @@ var interfaceNamesInGlobalScope =
{name: "MozWifiConnectionInfoEvent", b2g: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozWifiStatusChangeEvent", b2g: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozWifiP2pGroupOwner", b2g: true, permission: "wifi-manage"},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozWifiP2pManager", b2g: true, permission: "wifi-manage"},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozWifiP2pStatusChangeEvent", b2g: true, permission: "wifi-manage"},
// IMPORTANT: Do not change this list without review from a DOM peer!
"MutationEvent",
// IMPORTANT: Do not change this list without review from a DOM peer!
@ -1211,6 +1217,9 @@ function createInterfaceMap(isXBLScope) {
var isRelease = !version.contains("a");
var isDesktop = !/Mobile|Tablet/.test(navigator.userAgent);
var isB2G = !isDesktop && !navigator.userAgent.contains("Android");
var hasPermission = function (aPermission) {
return SpecialPowers.hasPermission(aPermission, window.document);
};
var interfaceMap = {};
@ -1224,7 +1233,8 @@ function createInterfaceMap(isXBLScope) {
(entry.desktop === !isDesktop) ||
(entry.b2g === !isB2G) ||
(entry.release === !isRelease) ||
(entry.pref && !prefs.getBoolPref(entry.pref))) {
(entry.pref && !prefs.getBoolPref(entry.pref)) ||
(entry.permission && !hasPermission(entry.permission))) {
interfaceMap[entry.name] = false;
} else {
interfaceMap[entry.name] = shouldExpect;