Bug 1675349: Update tests under dom/security/test for the removal of plugins. r=jmathies

UPDATED
-------
dom/security/test/mixedcontentblocker/file_main.html
Bug 62178
Test "insecure requests from a secure context".
Switch to use image/png instead of application/x-test (test plugin) when testing <object>

Differential Revision: https://phabricator.services.mozilla.com/D95911
This commit is contained in:
David Parks 2020-11-18 15:58:28 +00:00
parent 90be6e1a12
commit ed2fbf09ae
3 changed files with 8 additions and 8 deletions

View File

@ -78,7 +78,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=62178
var object = document.createElement("object");
var objectId = uniqueID();
object.data = baseUrl + "?type=object" + uniqueIDParam(objectId);
object.type = "application/x-test";
object.type = "image/png";
object.width = "200";
object.height = "200";
@ -87,15 +87,17 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=62178
var objectCount = 0;
function objectStatus(object) {
// Expose our privileged bits on the object
// Expose our privileged bits on the object. We will match the MIME type to the one
// provided by file_server.sjs
object = SpecialPowers.wrap(object);
if (object.displayedType != SpecialPowers.Ci.nsIObjectLoadingContent.TYPE_NULL) {
var typeIsSet = object.actualType && (object.actualType !== '');
var isLoaded = typeIsSet && object.actualType === 'application/x-test-match';
if (isLoaded) {
//object loaded
report("object", "insecure object loaded");
}
else {
if(objectCount < MAX_COUNT) {
if(!typeIsSet && objectCount < MAX_COUNT) {
objectCount++;
setTimeout(objectStatus, TIMEOUT_INTERVAL, object);
}

View File

@ -106,7 +106,7 @@ function handleRequest(request, response)
break;
case "object":
response.setHeader("Content-Type", "application/x-test", false);
response.setHeader("Content-Type", "application/x-test-match", false);
break;
case "xhr":

View File

@ -11,8 +11,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=62178
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script>
SpecialPowers.setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
let counter = 0;
// blockDisplay blockActive upgradeDisplay
const settings = [