Bug 1025994 - Rewrite webapps-manage test. r=baku

This commit is contained in:
David Chan 2014-06-26 15:00:52 -07:00
parent c34497e879
commit 7e2824c0c1
2 changed files with 9 additions and 16 deletions

View File

@ -21,7 +21,13 @@ TestData.prototype = {
return null;
}
var obj = window.navigator[this.obj];
// split on . to allow nested props
var props = this.obj.split(".");
var obj = window.navigator;
for (var i = 0; i < props.length && obj !== undefined; i++) {
obj = obj[props[i]];
}
if ((this.webidl && obj instanceof window[this.webidl]) ||
(this.idl && obj instanceof SpecialPowers.Ci[this.idl])) {

View File

@ -16,24 +16,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=815105
<pre id="test">
<script type="application/javascript;version=1.8" src="file_framework.js"></script>
<script type="application/javascript;version=1.8">
function verifier(success, failure) {
try {
var req = window.navigator.mozApps.mgmt.getAll();
req.onsuccess = function() {
success("Got mgmt");
}
req.onerror = function() {
failure("Got error");
}
} catch (e) {
failure("Got exception " + e);
}
}
var gData = [
{
perm: ["webapps-manage"],
verifier: verifier.toSource(),
obj: "mozApps.mgmt",
idl: "mozIDOMApplicationMgmt",
}
]
</script>