From 798b93a069854364de4400d956ecf8bdd945f932 Mon Sep 17 00:00:00 2001 From: Sandor Molnar Date: Wed, 21 Jul 2021 02:08:16 +0300 Subject: [PATCH] Backed out changeset 733ddb26d3b2 (bug 1719598) for causing xpc failures in test_getFromTypeAndExtension. CLOSED TREE --- .../exthandler/nsExternalHelperAppService.cpp | 2 +- .../tests/unit/test_getFromTypeAndExtension.js | 17 ----------------- uriloader/exthandler/tests/unit/xpcshell.ini | 1 - 3 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 uriloader/exthandler/tests/unit/test_getFromTypeAndExtension.js diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp index e44b0594dc43..820f3d0af36f 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -2800,7 +2800,7 @@ NS_IMETHODIMP nsExternalHelperAppService::GetFromTypeAndExtension( // XXXzpao This should probably be localized nsAutoCString desc(aFileExt); desc.AppendLiteral(" File"); - (*_retval)->SetDescription(NS_ConvertUTF8toUTF16(desc)); + (*_retval)->SetDescription(NS_ConvertASCIItoUTF16(desc)); LOG(("Falling back to 'File' file description\n")); } diff --git a/uriloader/exthandler/tests/unit/test_getFromTypeAndExtension.js b/uriloader/exthandler/tests/unit/test_getFromTypeAndExtension.js deleted file mode 100644 index 279eb8e20f6c..000000000000 --- a/uriloader/exthandler/tests/unit/test_getFromTypeAndExtension.js +++ /dev/null @@ -1,17 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. -http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -add_task(async function test_utf8_extension() { - const mimeService = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService); - let someMIME = mimeService.getFromTypeAndExtension( - "application/x-gobbledygook", - ".тест" - ); - Assert.stringContains(someMIME.description, "тест"); - // primary extension isn't set on macOS, see bug 1721181 - if (AppConstants.platform != "macosx") { - Assert.equal(someMIME.primaryExtension, ".тест"); - } -}); diff --git a/uriloader/exthandler/tests/unit/xpcshell.ini b/uriloader/exthandler/tests/unit/xpcshell.ini index f309424fc7f4..d7bf9e54d63a 100644 --- a/uriloader/exthandler/tests/unit/xpcshell.ini +++ b/uriloader/exthandler/tests/unit/xpcshell.ini @@ -7,7 +7,6 @@ firefox-appdir = browser # No default stored handlers on android given lack of support. # No default stored handlers on Thunderbird. skip-if = os == "android" || appname == "thunderbird" -[test_getFromTypeAndExtension.js] [test_getMIMEInfo_pdf.js] [test_getMIMEInfo_unknown_mime_type.js] run-if = os == "win" # Windows only test