From d561f09369b3d448bf180c42190b2b378106361d Mon Sep 17 00:00:00 2001 From: "vladimir@pobox.com" Date: Thu, 20 Mar 2008 16:55:44 -0700 Subject: [PATCH] fix up unit test to accept '.jpeg' on linux --- docshell/test/unit/test_bug414201_jfif.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docshell/test/unit/test_bug414201_jfif.js b/docshell/test/unit/test_bug414201_jfif.js index a29a52b0d5fa..6b32f85be35c 100644 --- a/docshell/test/unit/test_bug414201_jfif.js +++ b/docshell/test/unit/test_bug414201_jfif.js @@ -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); } }