diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /devtools/server/tracer/tests/browser | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/server/tracer/tests/browser')
-rw-r--r-- | devtools/server/tracer/tests/browser/WorkerDebugger.tracer.js | 17 | ||||
-rw-r--r-- | devtools/server/tracer/tests/browser/browser_document_tracer.js | 18 |
2 files changed, 18 insertions, 17 deletions
diff --git a/devtools/server/tracer/tests/browser/WorkerDebugger.tracer.js b/devtools/server/tracer/tests/browser/WorkerDebugger.tracer.js index bd6e646b3b..ef15fd5cfb 100644 --- a/devtools/server/tracer/tests/browser/WorkerDebugger.tracer.js +++ b/devtools/server/tracer/tests/browser/WorkerDebugger.tracer.js @@ -1,6 +1,6 @@ "use strict"; -/* global global, loadSubScript */ +/* global global */ try { // For some reason WorkerDebuggerGlobalScope.global doesn't expose JS variables @@ -8,8 +8,11 @@ try { const dbg = new Debugger(global); const [debuggee] = dbg.getDebuggees(); - /* global startTracing, stopTracing, addTracingListener, removeTracingListener */ - loadSubScript("resource://devtools/server/tracer/tracer.jsm"); + const { JSTracer } = ChromeUtils.importESModule( + "resource://devtools/server/tracer/tracer.sys.mjs", + { global: "contextual" } + ); + const frames = []; const listener = { onTracingFrame(args) { @@ -19,13 +22,13 @@ try { return true; }, }; - addTracingListener(listener); - startTracing({ global, prefix: "testWorkerPrefix" }); + JSTracer.addTracingListener(listener); + JSTracer.startTracing({ global, prefix: "testWorkerPrefix" }); debuggee.executeInGlobal("foo()"); - stopTracing(); - removeTracingListener(listener); + JSTracer.stopTracing(); + JSTracer.removeTracingListener(listener); // Send the frames to the main thread to do the assertions there. postMessage(JSON.stringify(frames)); diff --git a/devtools/server/tracer/tests/browser/browser_document_tracer.js b/devtools/server/tracer/tests/browser/browser_document_tracer.js index dcf2c9eb4d..d7d351d6dd 100644 --- a/devtools/server/tracer/tests/browser/browser_document_tracer.js +++ b/devtools/server/tracer/tests/browser/browser_document_tracer.js @@ -17,12 +17,10 @@ add_task(async function testTracingWorker() { const tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_URL); await SpecialPowers.spawn(tab.linkedBrowser, [], async () => { - const { - addTracingListener, - removeTracingListener, - startTracing, - stopTracing, - } = ChromeUtils.import("resource://devtools/server/tracer/tracer.jsm"); + const { JSTracer } = ChromeUtils.importESModule( + "resource://devtools/server/tracer/tracer.sys.mjs", + { global: "shared" } + ); // We have to fake opening DevTools otherwise DebuggerNotificationObserver wouldn't work // and the tracer wouldn't be able to trace the DOM events. @@ -35,10 +33,10 @@ add_task(async function testTracingWorker() { }, }; info("Register a tracing listener"); - addTracingListener(listener); + JSTracer.addTracingListener(listener); info("Start tracing the iframe"); - startTracing({ global: content, traceDOMEvents: true }); + JSTracer.startTracing({ global: content, traceDOMEvents: true }); info("Dispatch a click event on the iframe"); EventUtils.synthesizeMouseAtCenter( @@ -58,8 +56,8 @@ add_task(async function testTracingWorker() { is(lastFrame.formatedDisplayName, "λ bar"); is(lastFrame.currentDOMEvent, "setTimeoutCallback"); - stopTracing(); - removeTracingListener(listener); + JSTracer.stopTracing(); + JSTracer.removeTracingListener(listener); ChromeUtils.notifyDevToolsClosed(); }); |