зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1168676 - Switch off embed/object ServiceWorker interception. r=ehsan
I would have liked to watch for onerror on the tags instead of having these todos(), but onerror does not seem to fire. I have locally verified that the test does indeed receive 404s on the network console. --HG-- extra : rebase_source : bb1c9150b3efc0c8ea3027ec8f59198d31d13039
This commit is contained in:
Родитель
d5a3e3926a
Коммит
e5964f4913
|
@ -20,6 +20,7 @@
|
|||
#include "nsIDOMHTMLObjectElement.h"
|
||||
#include "nsIDOMHTMLAppletElement.h"
|
||||
#include "nsIExternalProtocolHandler.h"
|
||||
#include "nsIHttpChannelInternal.h"
|
||||
#include "nsIObjectFrame.h"
|
||||
#include "nsIPermissionManager.h"
|
||||
#include "nsPluginHost.h"
|
||||
|
@ -2509,6 +2510,8 @@ nsObjectLoadingContent::OpenChannel()
|
|||
scriptChannel->SetExecutionPolicy(nsIScriptChannel::EXECUTE_NORMAL);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIHttpChannelInternal> internalChannel = do_QueryInterface(httpChan);
|
||||
internalChannel->ForceNoIntercept();
|
||||
// AsyncOpen can fail if a file does not exist.
|
||||
rv = chan->AsyncOpen(shim, nullptr);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
|
|
@ -11,6 +11,10 @@
|
|||
ok(a === b, msg + ", expected '" + b + "', got '" + a + "'");
|
||||
}
|
||||
|
||||
function todo(v, msg) {
|
||||
window.parent.postMessage({status: "todo", result: !!v, message: msg}, "*");
|
||||
}
|
||||
|
||||
function finish() {
|
||||
window.parent.postMessage({status: "done"}, "*");
|
||||
}
|
||||
|
@ -114,6 +118,10 @@
|
|||
}
|
||||
|
||||
function testEmbed() {
|
||||
return Promise.resolve().then(function() {
|
||||
todo(false, "<embed> tag is not currently intercepted. See Bug 1168676.");
|
||||
});
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
var embed = document.createElement("embed");
|
||||
embed.src = "embed";
|
||||
|
@ -130,6 +138,10 @@
|
|||
}
|
||||
|
||||
function testObject() {
|
||||
return Promise.resolve().then(function() {
|
||||
todo(false, "<object> tag is not currently intercepted. See Bug 1168676");
|
||||
});
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
var object = document.createElement("object");
|
||||
object.data = "object";
|
||||
|
@ -223,11 +235,16 @@
|
|||
}
|
||||
|
||||
function testPlugin() {
|
||||
return Promise.resolve().then(function() {
|
||||
todo(false, "plugins are not currently intercepted. See Bug 1168676.");
|
||||
});
|
||||
|
||||
var isMobile = /Mobile|Tablet/.test(navigator.userAgent);
|
||||
if (isMobile || parent.isMulet()) {
|
||||
// We can't use plugins on mobile, so skip this part of the test there.
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
var embed = document.createElement("embed");
|
||||
embed.type = "application/x-test";
|
||||
|
|
|
@ -64,6 +64,8 @@
|
|||
window.onmessage = function(e) {
|
||||
if (e.data.status == "ok") {
|
||||
ok(e.data.result, e.data.message);
|
||||
} else if (e.data.status == "todo") {
|
||||
todo(e.data.result, e.data.message);
|
||||
} else if (e.data.status == "registrationdone") {
|
||||
iframe.src = "/tests/dom/workers/test/serviceworkers/fetch/context/index.html";
|
||||
} else if (e.data.status == "done") {
|
||||
|
|
Загрузка…
Ссылка в новой задаче