Bug 912918 - Part 3: Keep validating after errors when possible. r=paul

--HG--
extra : rebase_source : c4241212495876f6539a82f9ce8b5df52463f960
This commit is contained in:
J. Ryan Stinnett 2013-11-07 15:51:23 -06:00
parent addc9c2cfe
commit dd38817660
4 changed files with 29 additions and 1 deletions

View File

@ -112,7 +112,6 @@ AppValidator.prototype._getManifest = function () {
AppValidator.prototype.validateManifest = function (manifest) {
if (!manifest.name) {
this.error(strings.GetStringFromName("validator.missNameManifestProperty"));
return;
}
if (!manifest.icons || Object.keys(manifest.icons).length === 0) {

View File

@ -141,8 +141,34 @@
next();
});
},
// Test multiple failures (missing name [error] and icon [warning])
function () {
let validator = createHosted("no-name-or-icon");
validator.validate().then(() => {
checkNoNameOrIcon(validator);
});
},
function () {
let validator = createPackaged("no-name-or-icon");
validator.validate().then(() => {
checkNoNameOrIcon(validator);
});
}
];
function checkNoNameOrIcon(validator) {
is(validator.errors.length, 1, "app with no name has an error");
is(validator.errors[0],
strings.GetStringFromName("validator.missNameManifestProperty"),
"with expected message");
is(validator.warnings.length, 1, "app with no icon has a warning");
is(validator.warnings[0],
strings.GetStringFromName("validator.missIconsManifestProperty"),
"with expected message");
next();
}
</script>
</body>
</html>

View File

@ -0,0 +1,3 @@
{
"launch_path": "/home.html"
}