Skip to content
Snippets Groups Projects
Commit ea1f6c24 authored by Butkovits Atila's avatar Butkovits Atila
Browse files

Backed out 2 changesets (bug 1908095) for causing failures at...

Backed out 2 changesets (bug 1908095) for causing failures at browser_dbg-features-breakpoints.js. a=backout

Backed out changeset 21bf8880f772 (bug 1908095)
Backed out changeset 85060db8ce99 (bug 1908095)
parent 66bfb95e
No related branches found
No related tags found
No related merge requests found
Showing
with 22 additions and 231 deletions
......@@ -2,11 +2,6 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/shared-head.js",
this
);
/* import-globals-from helper-addons.js */
Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this);
......@@ -14,10 +9,10 @@ const L10N = new LocalizationHelper(
"devtools/client/locales/toolbox.properties"
);
const EXTENSION_NAME = "temporary-web-extension";
const EXTENSION_ID = "test-devtools@mozilla.org";
add_task(async () => {
const EXTENSION_NAME = "temporary-web-extension";
const EXTENSION_ID = "test-devtools@mozilla.org";
add_task(async function testOpenDebuggerReload() {
await enableExtensionDebugging();
info(
......@@ -89,61 +84,3 @@ add_task(async function testOpenDebuggerReload() {
await removeTemporaryExtension(EXTENSION_NAME, document);
await removeTab(tab);
});
add_task(async function testAddAndRemoveBreakpoint() {
await enableExtensionDebugging();
const { document, tab, window } = await openAboutDebugging();
await selectThisFirefoxPage(document, window.AboutDebugging.store);
await installTemporaryExtensionFromXPI(
{
background() {
window.invokeLogFromWebextension = () => {
console.log("From webextension");
};
},
id: EXTENSION_ID,
name: EXTENSION_NAME,
},
document
);
// Select the debugger right away to avoid any noise coming from the inspector.
await pushPref("devtools.toolbox.selectedTool", "jsdebugger");
const { devtoolsWindow } = await openAboutDevtoolsToolbox(
document,
tab,
window,
EXTENSION_NAME
);
const toolbox = getToolbox(devtoolsWindow);
const dbg = createDebuggerContext(toolbox);
info("Select the source and add a breakpoint");
// Note: the background script filename is dynamically generated id, so we
// simply get the first source from the list.
const displayedSources = dbg.selectors.getDisplayedSourcesList();
const backgroundScript = displayedSources[0];
await selectSource(dbg, backgroundScript);
await addBreakpoint(dbg, backgroundScript, 3);
info("Trigger the breakpoint and wait for the debugger to pause");
const webconsole = await toolbox.selectTool("webconsole");
const { hud } = webconsole;
hud.ui.wrapper.dispatchEvaluateExpression("invokeLogFromWebextension()");
await waitForPaused(dbg);
info("Resume and remove the breakpoint");
await resume(dbg);
await removeBreakpoint(dbg, backgroundScript.id, 3);
info("Trigger the function again and check the debugger does not pause");
hud.ui.wrapper.dispatchEvaluateExpression("invokeLogFromWebextension()");
await wait(500);
assertNotPaused(dbg);
await closeWebExtAboutDevtoolsToolbox(devtoolsWindow, window);
await removeTemporaryExtension(EXTENSION_NAME, document);
await removeTab(tab);
});
......@@ -19,14 +19,12 @@ add_task(async function testBreakableLinesOverReloads() {
);
info("Assert breakable lines of the first html page load");
await assertBreakableLines(dbg, "index.html", 85, [
await assertBreakableLines(dbg, "index.html", 78, [
...getRange(16, 17),
21,
...getRange(24, 25),
30,
36,
39,
...getRange(41, 43),
]);
info("Assert breakable lines of the first original source file, original.js");
......
......@@ -30,7 +30,7 @@ add_task(async function testBreakableLinesOverReloads() {
);
info("Assert breakable lines of the first html page load");
await assertBreakablePositions(dbg, "index.html", 85, [
await assertBreakablePositions(dbg, "index.html", 78, [
{ line: 16, columns: [6, 14] },
{ line: 17, columns: [] },
{ line: 21, columns: [12, 20, 48] },
......@@ -38,23 +38,16 @@ add_task(async function testBreakableLinesOverReloads() {
{ line: 25, columns: [] },
{ line: 30, columns: [] },
{ line: 36, columns: [] },
{ line: 39, columns: [] },
{ line: 41, columns: [8, 18] },
{ line: 42, columns: [] },
{ line: 43, columns: [] },
]);
info("Pretty print first html page load and assert breakable lines");
await prettyPrint(dbg);
await assertBreakablePositions(dbg, "index.html:formatted", 96, [
await assertBreakablePositions(dbg, "index.html:formatted", 87, [
{ line: 16, columns: [0, 8] },
{ line: 22, columns: [0, 8, 35] },
{ line: 27, columns: [0, 8] },
{ line: 28, columns: [] },
{ line: 36, columns: [] },
{ line: 48, columns: [] },
{ line: 50, columns: [2, 12] },
{ line: 53, columns: [] },
]);
await closeTab(dbg, "index.html:formatted");
......
......@@ -71,62 +71,3 @@ add_task(
await assertNotPaused(dbg);
}
);
/**
* Tests that the source tree works with all the various types of sources
* coming from the integration test page.
*
* Also assert a few extra things on sources with query strings:
* - they can be pretty printed,
* - quick open matches them,
* - you can set breakpoint on them.
*/
add_task(async function testSourceTreeOnTheIntegrationTestPage() {
const dbg = await initDebuggerWithAbsoluteURL("about:blank");
await navigateToAbsoluteURL(
dbg,
TEST_URL,
"index.html",
"script.js",
"log-worker.js"
);
info("Select the source and add a breakpoint");
await selectSource(dbg, "script.js");
await addBreakpoint(dbg, "script.js", 7);
info("Trigger the breakpoint and wait for the debugger to pause");
invokeInTab("nonSourceMappedFunction");
await waitForPaused(dbg);
info("Resume and remove the breakpoint");
await resume(dbg);
await removeBreakpoint(dbg, findSource(dbg, "script.js").id, 7);
info("Trigger the function again and check the debugger does not pause");
invokeInTab("nonSourceMappedFunction");
await wait(500);
assertNotPaused(dbg);
info("[worker] Select the source and add a breakpoint");
await selectSource(dbg, "log-worker.js");
await addBreakpoint(dbg, "log-worker.js", 2);
info("[worker] Trigger the breakpoint and wait for the debugger to pause");
invokeInTab("invokeLogWorker");
await waitForPaused(dbg);
info("[worker] Resume and remove the breakpoint");
await resume(dbg);
await removeBreakpoint(dbg, findSource(dbg, "log-worker.js").id, 2);
info(
"[worker] Trigger the function again and check the debugger does not pause"
);
invokeInTab("invokeLogWorker");
await wait(500);
assertNotPaused(dbg);
dbg.toolbox.closeToolbox();
});
......@@ -320,12 +320,11 @@ add_task(async function testSourceTreeOnTheIntegrationTestPage() {
.getAllThreads()
.find(thread => thread.name == "Main Thread");
// When EFT is disabled the iframe's source is meld into the main target.
const expectedSameUrlSources = isEveryFrameTargetEnabled() ? 3 : 4;
is(
sourceActors.filter(actor => actor.thread == mainThread.actor).length,
expectedSameUrlSources,
`same-url.js is loaded ${expectedSameUrlSources} times in the main thread`
// When EFT is disabled the iframe's source is meld into the main target
isEveryFrameTargetEnabled() ? 3 : 4,
"same-url.js is loaded 3 times in the main thread"
);
if (isEveryFrameTargetEnabled()) {
......
......@@ -11,10 +11,10 @@
"license": "MPL-2.0",
"dependencies": {},
"devDependencies": {
"@babel/core": "7.25.2",
"babel-loader": "7.1.2",
"babel-preset-es2015": "6.24.1",
"webpack": "4.47.0",
"webpack-cli": "4.10.0"
"babel-core": "^7.0.0-beta.3",
"babel-loader": "^7.1.2",
"babel-preset-es2015": "^6.24.1",
"webpack": "^4",
"webpack-cli": ""
}
}
......@@ -35,13 +35,6 @@
`);
</script>
<script>
const logWorker = new Worker("log-worker.js");
function invokeLogWorker() {
logWorker.postMessage({yo: 'yo'})
}
</script>
<!-- Test JS file with encoded characters as well as custom protocol -->
<script>
//# sourceURL=foo://bar/%e6%96%87%e5%ad%97%e3%82%b3%e3%83%bc%e3%83%89.js
......@@ -75,9 +68,6 @@
<!-- Another bundle/generated source that contains removed-original.js -->
<script src="replaced-bundle.js"></script>
<!-- A script that looks like a react module -->
<script src="react-component-module.js"></script>
<iframe src="iframe.html"></script>
</body>
......
self.onmessage = function onmessage() {
console.log("hi");
};
// Use a code pattern identified by the parser worker to classify this module as a React Component
var isReactComponent = true;
......@@ -3,6 +3,6 @@ console.log("only one breakable line");
function nonSourceMappedFunction () {
console.log("non source mapped function");
// This will call a function from removed-original.js
return removedOriginal();
// This will call a function from original-with-query.js
return originalWithQuery();
}
......@@ -35,13 +35,6 @@
`);
</script>
<script>
const logWorker = new Worker("log-worker.js");
function invokeLogWorker() {
logWorker.postMessage({yo: 'yo'})
}
</script>
<!-- Test JS file with encoded characters as well as custom protocol -->
<script>
//# sourceURL=foo://bar/%e6%96%87%e5%ad%97%e3%82%b3%e3%83%bc%e3%83%89.js
......
self.onmessage = function onmessage() {
console.log("hi");
};
......@@ -136,7 +136,6 @@ const INTEGRATION_TEST_PAGE_SOURCES = [
// But there is even more source actors (named evals and duplicated script tags).
"same-url.sjs",
"same-url.sjs",
"log-worker.js",
];
// The iframe one is only available when fission is enabled, or EFT
if (isFissionEnabled() || isEveryFrameTargetEnabled()) {
......
......@@ -461,51 +461,18 @@ export class DevToolsProcessChild extends JSProcessActorChild {
if (!watcherDataObject) {
return;
}
const { actors, sessionData, watchingTargetTypes } = watcherDataObject;
// Maintain the copy of `sessionData` so that it is up-to-date when
// a new worker target needs to be instantiated
lazy.SessionDataHelpers.removeSessionDataEntry(sessionData, type, entries);
lazy.SessionDataHelpers.removeSessionDataEntry(
watcherDataObject.sessionData,
type,
entries
);
for (const targetActor of actors) {
for (const targetActor of watcherDataObject.actors) {
targetActor.removeSessionDataEntry(type, entries);
}
// Special code paths for webextension toolboxes and worker targets
// See addOrSetSessionDataEntry for more details.
if (sessionData.sessionContext.type == "webextension") {
const connectionPrefix = watcherActorID.replace(/watcher\d+$/, "");
const targetActors = lazy.TargetActorRegistry.getTargetActors(
sessionData.sessionContext,
connectionPrefix
);
if (targetActors.length) {
targetActors[0].removeSessionDataEntry(type, entries);
}
}
if (watchingTargetTypes.includes("worker")) {
this.#watchers.worker.watcher.removeSessionDataEntry(
watcherDataObject,
type,
entries
);
}
if (watchingTargetTypes.includes("service_worker")) {
this.#watchers.service_worker.watcher.removeSessionDataEntry(
watcherDataObject,
type,
entries
);
}
if (watchingTargetTypes.includes("shared_worker")) {
this.#watchers.shared_worker.watcher.removeSessionDataEntry(
watcherDataObject,
type,
entries
);
}
}
/**
......
......@@ -76,24 +76,6 @@ export class WorkerTargetWatcherClass {
await Promise.all(promises);
}
removeSessionDataEntry(watcherDataObject, type, entries) {
for (const { dbg, workerThreadServerForwardingPrefix } of watcherDataObject
.workers[this.#workerTargetType]) {
if (!isWorkerDebuggerAlive(dbg)) {
continue;
}
dbg.postMessage(
JSON.stringify({
type: "remove-session-data-entry",
forwardingPrefix: workerThreadServerForwardingPrefix,
dataEntryType: type,
entries,
})
);
}
}
/**
* Called whenever a new Worker is instantiated in the current process
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment