Files
palemoon27/security/manager/ssl/tests/mochitest/mixedcontent/test_bug383369.html
T
roytam1 81d61fa324 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1265036 - Use NS_ABORT_OOM() if try_realloc() fails. r=billm (c30f4f83d5)
- Bug 1263292 - Handle calling realloc(0) (r=jld) (f292859ee9)
- Bug 1256366 - Remove linear and exponential stats collection from histogram.cc. r=gfritzsche (f9a1c869a1)
- Bug 1263953 - Reduce the growth rate of Pickle. r=wmccloskey (6eb5228490)
- Bug 1233275 - Copy environment for IPC using NSPR. r=jld (2004db748e)
- Bug 1261094 - Improve how MessageChannel::mInterruptStack is used in IPC code, r=jld (56e2c114a4)
- Bug 1246931: Include dbus.h in DBus IPC headers, r=shuang (43e797c2d8)
- Bug 1264887: Make DBus helpers available on desktop builds, r=shuang (58bff1f640)
- Bug 1268130, part 1 - Reimplement ByteLengthIsValid using CheckedInt. r=froydnj (6018e22ae0)
- Bug 1268130, part 2 - Make ByteLengthIsValid failures fatal in release builds. r=froydnj (f9d934a498)
- Bug 1269365, part 1 - Swap fallible and infallible TArray ParamTraits. r=froydnj (ad423bc04d)
- Bug 1269365, part 2 - Make ParamTraits<nsTArray<E>>::Read use infallible allocation. r=froydnj (9b902a5bc4)
- Bug 1269365, part 3 - Use infallible array allocation in implementSpecialArrayPickling. r=froydnj (592fe648d3)
- Bug 1264820 - Measure IPC reply size in telemetry (r=mccr8) (62c54d3141)
- Bug 1268938 - Use the name of the original message in Send for reply telemetry. r=billm (a2de5c6a91)
- Bug 1266954: Remove temporary |ScopedClose| from PDU receive code, r=jacheng (cb06315c33)
- Bug 1142109 - Fix IPDL tests (r=dvander) (df3f0cda32)
- Bug 1177013 - Fix IPDL tests for not allowing CPOWs during sync (r=dvander) (5da0a8a4c9)
- Bug 1261307: Convert RIL sockets to |UniquePtr|, r=nfroyd (08609783b3)
- Bug 1253622 - Move the mozilla-trace.h generation into moz.build; r=ted (f01dc418bc)
- Bug 1267318 ignore cert expiration for mozilla-signed packages, r=dkeeler (7a1ddd6090)
- Bug 1029173 - Clean up nsDataSignatureVerifier. r=keeler (f9602341ea)
- bug 1267463 - add a more nuanced subject common name fallback option for prerelease channels r=Cykesiopka,jcj (9b55320c9b)
- Bug 1253108 - Enable ESLint "strict" rule for PSM. r=keeler (54802bdc38)
- Bug 1255425 - part 1 - clearly delineate steps when outputting HSTS preload list; r=keeler (79f73189c8)
- Bug 1251801 - Fully implement nsNSSShutDownObject and obviate manual NSS resource management. r=keeler (af32315d3f)
- Bug 1251801 - Improve handling of PK11_* function error codes. r=keeler (9f2c8ac64b)
- Fix unified-build bustage from bug 1264706. r=bustage (11bc0417c7)
- Bug 1265164 - Always use nsCOMPtrs with getNSSDialogs(). r=keeler (ce5a703972)
2024-09-03 10:19:02 +08:00

136 lines
4.8 KiB
HTML

<!DOCTYPE HTML>
<html>
<head>
<title>Bug 383369 test</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="mixedContentTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script class="testbody" type="text/javascript">
/* import-globals-from mixedContentTest.js */
"use strict";
// We want to start this test from an insecure context
loadAsInsecure = true;
// We don't want to go through the navigation back/forward test
bypassNavigationTest = true;
function runTest()
{
// Force download to be w/o user assistance for our testing mime type
const mimeSvc = SpecialPowers.Cc["@mozilla.org/mime;1"]
.getService(SpecialPowers.Ci.nsIMIMEService);
var handlerInfo = mimeSvc.getFromTypeAndExtension("application/x-auto-download", "auto");
handlerInfo.preferredAction = SpecialPowers.Ci.nsIHandlerInfo.saveToDisk;
handlerInfo.alwaysAskBeforeHandling = false;
handlerInfo.preferredApplicationHandler = null;
const handlerSvc = SpecialPowers.Cc["@mozilla.org/uriloader/handler-service;1"]
.getService(SpecialPowers.Ci.nsIHandlerService);
handlerSvc.store(handlerInfo);
var dirProvider = SpecialPowers.Cc["@mozilla.org/file/directory_service;1"]
.getService(SpecialPowers.Ci.nsIProperties);
var profileDir = dirProvider.get("ProfDS", SpecialPowers.Ci.nsIFile);
profileDir.append("downloads");
var prefs = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
.getService(SpecialPowers.Ci.nsIPrefService);
prefs = prefs.getBranch("browser.download.");
prefs.setCharPref("dir", profileDir.path);
prefs.setBoolPref("useDownloadDir", true);
prefs.setIntPref("folderList", 2);
prefs.setBoolPref("manager.closeWhenDone", true);
prefs.setBoolPref("manager.showWhenStarting", false);
var theWindow = window;
var useJSTransfer = false;
try {
// This method throws an exception if the old Download Manager is disabled.
Services.downloads.activeDownloadCount;
} catch (ex) {
useJSTransfer = true;
}
if (useJSTransfer) {
var Downloads = SpecialPowers.Cu.import("resource://gre/modules/Downloads.jsm").Downloads;
Downloads.getList(Downloads.PUBLIC).then(list => {
list = SpecialPowers.wrap(list);
list.addView({
onDownloadAdded: function (aDownload) {
list.removeView(this);
SpecialPowers.wrap(aDownload).whenSucceeded().then(() => {
list.removeFinished();
theWindow.location = "bug383369step2.html";
});
},
});
window.location = "download.auto";
}).then(null, SpecialPowers.Cu.reportError);
return;
}
var downloadManager = SpecialPowers.Cc["@mozilla.org/download-manager;1"]
.getService(SpecialPowers.Ci.nsIDownloadManager);
var observer = {
observe: function(subject, topic, data) {
switch (topic) {
case "dl-done":
case "dl-failed":
case "dl-blocked":
case "dl-dirty":
downloadManager.cleanUp();
theWindow.location = "bug383369step2.html";
observerService.removeObserver(this, "dl-done");
observerService.removeObserver(this, "dl-failed");
observerService.removeObserver(this, "dl-blocked");
observerService.removeObserver(this, "dl-dirty");
break;
}
}
};
var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
.getService(SpecialPowers.Ci.nsIObserverService);
observerService.addObserver(observer, "dl-done", false);
observerService.addObserver(observer, "dl-failed", false);
observerService.addObserver(observer, "dl-blocked", false);
observerService.addObserver(observer, "dl-dirty", false);
window.location = "download.auto";
}
function afterNavigationTest()
{
}
testCleanUp = function cleanup()
{
const mimeSvc = SpecialPowers.Cc["@mozilla.org/mime;1"]
.getService(SpecialPowers.Ci.nsIMIMEService);
var handlerInfo = mimeSvc.getFromTypeAndExtension("application/x-auto-download", "auto");
const handlerSvc = SpecialPowers.Cc["@mozilla.org/uriloader/handler-service;1"]
.getService(SpecialPowers.Ci.nsIHandlerService);
handlerSvc.remove(handlerInfo);
var prefs = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
.getService(SpecialPowers.Ci.nsIPrefService);
prefs = prefs.getBranch("browser.download.");
var prefKeys = ["dir", "useDownloadDir", "folderList",
"manager.closeWhenDone", "manager.showWhenStarting"];
for (var i = 0; i < prefKeys.length; i++)
if (prefs.prefHasUserValue(prefKeys[i]))
prefs.clearUserPref(prefKeys[i]);
}
</script>
</head>
<body>
</body>
</html>