Bug 1643075, removed unused message manager usage from browser_test_performance_metrics.js, r=tarek

Differential Revision: https://phabricator.services.mozilla.com/D78108
This commit is contained in:
Neil Deakin 2020-06-04 00:07:25 +00:00
Родитель 84a0dd32fb
Коммит ee1cb77c68
1 изменённых файлов: 0 добавлений и 30 удалений

Просмотреть файл

@ -13,36 +13,6 @@ const TIMEOUT_URL = ROOT_URL + "/settimeout.html";
const SOUND_URL = ROOT_URL + "/sound.html";
const CATEGORY_TIMER = 2;
let nextId = 0;
function jsonrpc(tab, method, params) {
let currentId = nextId++;
let messageManager = tab.linkedBrowser.messageManager;
messageManager.sendAsyncMessage("jsonrpc", {
id: currentId,
method,
params,
});
return new Promise(function(resolve, reject) {
messageManager.addMessageListener("jsonrpc", function listener(event) {
let { id, result, error } = event.data;
if (id !== currentId) {
return;
}
messageManager.removeMessageListener("jsonrpc", listener);
if (error) {
reject(error);
return;
}
resolve(result);
});
});
}
function postMessageToWorker(tab, message) {
return jsonrpc(tab, "postMessageToWorker", [WORKER_URL, message]);
}
add_task(async function test() {
waitForExplicitFinish();