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
Родитель ba00ad3348
Коммит 5ef0e12cc1
4 изменённых файлов: 29 добавлений и 1 удалений

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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>

Просмотреть файл

Просмотреть файл

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