зеркало из https://github.com/mozilla/gecko-dev.git
Bug 980278 - Remove DataContainerEvent dependency from Mochitest. r=jmaher
This commit is contained in:
Родитель
1bd9e40c57
Коммит
26270a19ca
|
@ -58,7 +58,7 @@ function testOnLoad() {
|
|||
webNav.loadURI(url, null, null, null, null);
|
||||
};
|
||||
|
||||
var listener = 'data:,function doLoad(e) { var data=e.getData("data");removeEventListener("contentEvent", function (e) { doLoad(e); }, false, true);sendAsyncMessage("chromeEvent", {"data":data}); };addEventListener("contentEvent", function (e) { doLoad(e); }, false, true);';
|
||||
var listener = 'data:,function doLoad(e) { var data=e.detail&&e.detail.data;removeEventListener("contentEvent", function (e) { doLoad(e); }, false, true);sendAsyncMessage("chromeEvent", {"data":data}); };addEventListener("contentEvent", function (e) { doLoad(e); }, false, true);';
|
||||
messageManager.loadFrameScript(listener, true);
|
||||
messageManager.addMessageListener("chromeEvent", messageHandler);
|
||||
}
|
||||
|
|
|
@ -7,11 +7,14 @@
|
|||
{
|
||||
// We create a listener for this event in browser-test.js
|
||||
// which will get picked up when specifying --chrome or --a11y
|
||||
var element = document.createEvent("datacontainerevent");
|
||||
element.initEvent("contentEvent", true, false);
|
||||
element.setData("data", aURL + location.search);
|
||||
element.setData("type", "loadURI");
|
||||
document.dispatchEvent(element);
|
||||
var event = new CustomEvent("contentEvent", {
|
||||
bubbles: true,
|
||||
detail: {
|
||||
"data": aURL + location.search,
|
||||
"type": "loadURI"
|
||||
}
|
||||
});
|
||||
document.dispatchEvent(event);
|
||||
}
|
||||
|
||||
function onLoad() {
|
||||
|
|
|
@ -17,12 +17,15 @@ function contentDispatchEvent(type, data, sync) {
|
|||
data = {};
|
||||
}
|
||||
|
||||
var element = document.createEvent("datacontainerevent");
|
||||
element.initEvent("contentEvent", true, false);
|
||||
element.setData("sync", sync);
|
||||
element.setData("type", type);
|
||||
element.setData("data", JSON.stringify(data));
|
||||
document.dispatchEvent(element);
|
||||
var event = new CustomEvent("contentEvent", {
|
||||
bubbles: true,
|
||||
detail: {
|
||||
"sync": sync,
|
||||
"type": type,
|
||||
"data": JSON.stringify(data)
|
||||
}
|
||||
});
|
||||
document.dispatchEvent(event);
|
||||
}
|
||||
|
||||
function contentAsyncEvent(type, data) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче