From ee1cb77c68e45bbe21cba76ef827e5422c2a3d81 Mon Sep 17 00:00:00 2001 From: Neil Deakin Date: Thu, 4 Jun 2020 00:07:25 +0000 Subject: [PATCH] Bug 1643075, removed unused message manager usage from browser_test_performance_metrics.js, r=tarek Differential Revision: https://phabricator.services.mozilla.com/D78108 --- .../browser_test_performance_metrics.js | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/dom/tests/browser/perfmetrics/browser_test_performance_metrics.js b/dom/tests/browser/perfmetrics/browser_test_performance_metrics.js index 457d40f6e987..9f63482fb7bc 100644 --- a/dom/tests/browser/perfmetrics/browser_test_performance_metrics.js +++ b/dom/tests/browser/perfmetrics/browser_test_performance_metrics.js @@ -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();