fix up unit test to accept '.jpeg' on linux

This commit is contained in:
vladimir@pobox.com 2008-03-20 16:55:44 -07:00
Родитель 958f67e316
Коммит d561f09369
1 изменённых файлов: 7 добавлений и 5 удалений

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

@ -45,14 +45,16 @@ function run_test()
/* Test a few common image types to make sure that they get the right extension */
var types = {
"image/jpeg": "jpg",
"image/gif": "gif",
"image/png": "png"
"image/jpeg": ["jpg", "jpeg"], /* accept either */
"image/gif": ["gif"],
"image/png": ["png"]
};
/* Check whether the primary extension is what we'd expect */
for (var mimetype in types) {
var ext = types[mimetype];
do_check_true (ms.getFromTypeAndExtension(mimetype, null).primaryExtension.toLowerCase() == ext);
var exts = types[mimetype];
var primary = ms.getFromTypeAndExtension(mimetype, null).primaryExtension.toLowerCase();
do_check_true (exts.indexOf(primary) != -1);
}
}