gecko-dev/dom/apps/tests/test_list_api.xul

77 строки
2.1 KiB
XML

<?xml version="1.0"?>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="Mozilla Bug 741549">
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<script type="application/javascript" src="head.js"/>
<!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml">
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=741549"
target="_blank">Mozilla Bug 741549</a>
</body>
<script>
var props = {
checkInstalled: "function",
getAdditionalLanguages: "function",
getInstalled: "function",
getLocalizationResource: "function",
getSelf: "function",
install: "function",
installPackage: "function",
mgmt: "object",
};
var apps = [];
for (let p in navigator.mozApps) {
apps.push(p);
}
isDeeply(apps.sort(), Object.keys(props).sort(),
"navigator.mozApps has only the expected properties");
for (var p in props) {
is(typeof navigator.mozApps[p], props[p], "typeof " + p);
}
var mgmtProps = {
addEventListener: "function",
applyDownload: "function",
dispatchEvent: "function",
getEventHandler: "function",
getAll: "function",
getIcon: "function",
uninstall: "function",
oninstall: "object",
onuninstall: "object",
onenabledstatechange: "object",
ownerGlobal: "object",
removeEventListener: "function",
setEventHandler: "function",
extractManifest: "function",
import: "function",
setEnabled: "function"
};
var mgmts = [];
for (let p in navigator.mozApps.mgmt) {
mgmts.push(p);
}
isDeeply(mgmts.sort(),
Object.keys(mgmtProps).sort(),
"navigator.mozApps.mgmt has only the expected properties");
for (var p in mgmtProps) {
is(typeof navigator.mozApps.mgmt[p], mgmtProps[p], "typeof mgmt." + p);
}
</script>
</window>