mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Backed out 4 changesets (bug 1761921, bug 1761368) for causing dt failures on browser_dbg-features-source-tree.js CLOSED TREE
Backed out changeset f478fa1e3df3 (bug 1761368) Backed out changeset 49ad1260f76d (bug 1761368) Backed out changeset 0c34f0da19bc (bug 1761368) Backed out changeset b6bb54ecd127 (bug 1761921)
This commit is contained in:
parent
21609aed82
commit
c376790f3c
@ -29,7 +29,6 @@ prefs =
|
||||
|
||||
# Feature tests:
|
||||
[browser_dbg-features-asm.js]
|
||||
[browser_dbg-features-source-tree.js]
|
||||
[browser_dbg-features-source-text-content.js]
|
||||
[browser_dbg-features-wasm.js]
|
||||
|
||||
@ -207,6 +206,11 @@ skip-if = os == "win" || (verify) # Bug 1434792
|
||||
[browser_dbg-sourcemaps3.js]
|
||||
[browser_dbg-sourcemaps-bogus.js]
|
||||
skip-if = os == 'linux' && !asan # bug 1447118
|
||||
[browser_dbg-sources.js]
|
||||
[browser_dbg-sources-arrow-keys.js]
|
||||
[browser_dbg-sources-named-eval.js]
|
||||
[browser_dbg-sources-querystring.js]
|
||||
skip-if = true
|
||||
[browser_dbg-stepping.js]
|
||||
skip-if = debug || (verify && (os == 'win')) || (os == "win" && os_version == "6.1")
|
||||
[browser_dbg-step-in-uninitialized.js]
|
||||
|
@ -19,13 +19,7 @@ add_task(async function testBreakableLinesOverReloads() {
|
||||
);
|
||||
|
||||
info("Assert breakable lines of the first html page load");
|
||||
await assertBreakableLines(dbg, "index.html", 53, [
|
||||
[16, 17],
|
||||
[21],
|
||||
[23],
|
||||
[28],
|
||||
[34],
|
||||
]);
|
||||
await assertBreakableLines(dbg, "index.html", 22, [[17], [18]]);
|
||||
|
||||
info("Assert breakable lines of the first original source file, original.js");
|
||||
// The length of original.js is longer than the test file
|
||||
@ -50,7 +44,7 @@ add_task(async function testBreakableLinesOverReloads() {
|
||||
await assertBreakableLines(dbg, "script.js", 23, [[2], [13, 23]]);
|
||||
|
||||
info("Assert breakable lines of the second html page load");
|
||||
await assertBreakableLines(dbg, "index.html", 28, [[22], [24]]);
|
||||
await assertBreakableLines(dbg, "index.html", 22, [[16], [18]]);
|
||||
|
||||
info("Assert breakable lines of the second orignal file");
|
||||
// See first assertion about original.js,
|
||||
|
@ -30,13 +30,9 @@ add_task(async function testBreakableLinesOverReloads() {
|
||||
);
|
||||
|
||||
info("Assert breakable lines of the first html page load");
|
||||
await assertBreakablePositions(dbg, "index.html", 53, [
|
||||
{ line: 16, columns: [6, 14] },
|
||||
{ line: 17, columns: [] },
|
||||
{ line: 21, columns: [6, 14] },
|
||||
{ line: 23, columns: [] },
|
||||
{ line: 28, columns: [] },
|
||||
{ line: 34, columns: [] },
|
||||
await assertBreakablePositions(dbg, "index.html", 20, [
|
||||
{ line: 17, columns: [6, 14] },
|
||||
{ line: 18, columns: [] },
|
||||
]);
|
||||
|
||||
info("Assert breakable lines of the first original source file, original.js");
|
||||
@ -83,9 +79,9 @@ add_task(async function testBreakableLinesOverReloads() {
|
||||
]);
|
||||
|
||||
info("Assert breakable lines of the second html page load");
|
||||
await assertBreakablePositions(dbg, "index.html", 28, [
|
||||
{ line: 22, columns: [6, 14] },
|
||||
{ line: 24, columns: [] },
|
||||
await assertBreakablePositions(dbg, "index.html", 22, [
|
||||
{ line: 16, columns: [6, 14] },
|
||||
{ line: 18, columns: [] },
|
||||
]);
|
||||
|
||||
info("Assert breakable lines of the second orignal file");
|
||||
@ -110,8 +106,11 @@ async function assertBreakablePositions(
|
||||
breakablePositions
|
||||
) {
|
||||
await selectSource(dbg, file);
|
||||
const editorLines = dbg.win.document.querySelectorAll(
|
||||
".CodeMirror-lines .CodeMirror-code > div"
|
||||
);
|
||||
is(
|
||||
getCM(dbg).lineCount(),
|
||||
editorLines.length,
|
||||
numberOfLines,
|
||||
`We show the expected number of lines in CodeMirror for ${file}`
|
||||
);
|
||||
|
@ -8,23 +8,23 @@
|
||||
|
||||
add_task(async function() {
|
||||
await pushPref("devtools.chrome.enabled", true);
|
||||
const extension = await installAndStartContentScriptExtension();
|
||||
const extension = await installAndStartExtension();
|
||||
|
||||
let dbg = await initDebugger(
|
||||
"doc-content-script-sources.html",
|
||||
"content_script.js"
|
||||
);
|
||||
await selectSource(dbg, "content_script.js");
|
||||
let dbg = await initDebugger("doc-content-script-sources.html");
|
||||
await clickElement(dbg, "sourceDirectoryLabel", 2);
|
||||
|
||||
await selectContentScriptSources(dbg);
|
||||
await closeTab(dbg, "content_script.js");
|
||||
|
||||
// Destroy the toolbox and repeat the test in a new toolbox
|
||||
// and ensures that the content script is still listed.
|
||||
await dbg.toolbox.destroy();
|
||||
|
||||
const toolbox = await openToolboxForTab(gBrowser.selectedTab, "jsdebugger");
|
||||
dbg = createDebuggerContext(toolbox);
|
||||
await waitForSources(dbg, "content_script.js");
|
||||
await selectSource(dbg, "content_script.js");
|
||||
|
||||
await clickElement(dbg, "sourceDirectoryLabel", 2);
|
||||
|
||||
await selectContentScriptSources(dbg);
|
||||
|
||||
await addBreakpoint(dbg, "content_script.js", 2);
|
||||
|
||||
@ -50,3 +50,45 @@ add_task(async function() {
|
||||
|
||||
await extension.unload();
|
||||
});
|
||||
|
||||
async function selectContentScriptSources(dbg) {
|
||||
await waitForSources(dbg, "content_script.js");
|
||||
|
||||
// Select a source.
|
||||
await selectSource(dbg, "content_script.js");
|
||||
|
||||
ok(
|
||||
findElementWithSelector(dbg, ".sources-list .focused"),
|
||||
"Source is focused"
|
||||
);
|
||||
}
|
||||
|
||||
async function installAndStartExtension() {
|
||||
function contentScript() {
|
||||
console.log("content script loads");
|
||||
|
||||
// This listener prevents the source from being garbage collected
|
||||
// and be missing from the scripts returned by `dbg.findScripts()`
|
||||
// in `ThreadActor._discoverSources`.
|
||||
window.onload = () => {};
|
||||
}
|
||||
|
||||
const extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
content_scripts: [
|
||||
{
|
||||
js: ["content_script.js"],
|
||||
matches: ["https://example.com/*"],
|
||||
run_at: "document_start",
|
||||
},
|
||||
],
|
||||
},
|
||||
files: {
|
||||
"content_script.js": contentScript,
|
||||
},
|
||||
});
|
||||
|
||||
await extension.startup();
|
||||
|
||||
return extension;
|
||||
}
|
||||
|
@ -1,387 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
/**
|
||||
* This test focuses on the SourceTree component, where we display all debuggable sources.
|
||||
*
|
||||
* The first two tests expand the tree via manual DOM events (first with clicks and second with keys).
|
||||
* `waitForSourcesInSourceTree()` is a key assertion method. Passing `{noExpand: true}`
|
||||
* is important to avoid automatically expand the source tree.
|
||||
*
|
||||
* The following tests depend on auto-expand and only assert all the sources possibly displayed
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
const testServer = createVersionizedHttpTestServer(
|
||||
"examples/sourcemaps-reload-uncompressed"
|
||||
);
|
||||
const TEST_URL = testServer.urlFor("index.html");
|
||||
|
||||
const INTEGRATION_TEST_PAGE_SOURCES = [
|
||||
"index.html",
|
||||
"script.js",
|
||||
"test-functions.js",
|
||||
"query.js?x=1",
|
||||
"query.js?x=2",
|
||||
"bundle.js",
|
||||
"original.js",
|
||||
"replaced-bundle.js",
|
||||
"removed-original.js",
|
||||
"named-eval.js",
|
||||
"bootstrap 3b1a221408fdde86aa49",
|
||||
"bootstrap 6fda1f7ea9ecbc1a2d5b",
|
||||
];
|
||||
|
||||
/**
|
||||
* This test opens the SourceTree manually via click events on the nested source,
|
||||
* and then adds a source dynamically and asserts it is visible.
|
||||
*/
|
||||
add_task(async function testSimpleSourcesWithManualClickExpand() {
|
||||
const dbg = await initDebugger(
|
||||
"doc-sources.html",
|
||||
"simple1.js",
|
||||
"simple2.js",
|
||||
"nested-source.js",
|
||||
"long.js"
|
||||
);
|
||||
|
||||
// Expand nodes and make sure more sources appear.
|
||||
is(getLabel(dbg, 1), "Main Thread", "Main thread is labeled properly");
|
||||
info("Before interacting with the source tree, no source are displayed");
|
||||
await waitForSourcesInSourceTree(dbg, [], { noExpand: true });
|
||||
await clickElement(dbg, "sourceDirectoryLabel", 3);
|
||||
info(
|
||||
"After clicking on the directory, all sources but the nested ones are displayed"
|
||||
);
|
||||
await waitForSourcesInSourceTree(
|
||||
dbg,
|
||||
["doc-sources.html", "simple1.js", "simple2.js", "long.js"],
|
||||
{ noExpand: true }
|
||||
);
|
||||
|
||||
await clickElement(dbg, "sourceDirectoryLabel", 4);
|
||||
info(
|
||||
"After clicking on the nested directory, the nested source is also displayed"
|
||||
);
|
||||
await waitForSourcesInSourceTree(
|
||||
dbg,
|
||||
[
|
||||
"doc-sources.html",
|
||||
"simple1.js",
|
||||
"simple2.js",
|
||||
"long.js",
|
||||
"nested-source.js",
|
||||
],
|
||||
{ noExpand: true }
|
||||
);
|
||||
|
||||
const selected = waitForDispatch(dbg.store, "SET_SELECTED_LOCATION");
|
||||
await clickElement(dbg, "sourceNode", 5);
|
||||
await selected;
|
||||
await waitForSelectedSource(dbg, "nested-source.js");
|
||||
|
||||
// Ensure the source file clicked is now focused
|
||||
await waitForElementWithSelector(dbg, ".sources-list .focused");
|
||||
|
||||
const selectedSource = dbg.selectors.getSelectedSource().url;
|
||||
ok(selectedSource.includes("nested-source.js"), "nested-source is selected");
|
||||
await assertNodeIsFocused(dbg, 5);
|
||||
|
||||
// Make sure new sources appear in the list.
|
||||
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], function() {
|
||||
const script = content.document.createElement("script");
|
||||
script.src = "math.min.js";
|
||||
content.document.body.appendChild(script);
|
||||
});
|
||||
|
||||
info("After adding math.min.js, we got a new source displayed");
|
||||
await waitForSourcesInSourceTree(
|
||||
dbg,
|
||||
[
|
||||
"doc-sources.html",
|
||||
"simple1.js",
|
||||
"simple2.js",
|
||||
"long.js",
|
||||
"nested-source.js",
|
||||
"math.min.js",
|
||||
],
|
||||
{ noExpand: true }
|
||||
);
|
||||
is(
|
||||
getSourceNodeLabel(dbg, 8),
|
||||
"math.min.js",
|
||||
"math.min.js - The dynamic script exists"
|
||||
);
|
||||
|
||||
info("Assert that nested-source.js is still the selected source");
|
||||
await assertNodeIsFocused(dbg, 5);
|
||||
});
|
||||
|
||||
/**
|
||||
* Test keyboard arrow behaviour on the SourceTree with a nested folder
|
||||
* that we manually expand/collapse via arrow keys.
|
||||
*/
|
||||
add_task(async function testSimpleSourcesWithManualKeyShortcutsExpand() {
|
||||
const dbg = await initDebugger(
|
||||
"doc-sources.html",
|
||||
"simple1.js",
|
||||
"simple2.js",
|
||||
"nested-source.js",
|
||||
"long.js"
|
||||
);
|
||||
|
||||
// Before clicking on the source label, no source is displayed
|
||||
await waitForSourcesInSourceTree(dbg, [], { noExpand: true });
|
||||
await clickElement(dbg, "sourceDirectoryLabel", 3);
|
||||
// Right after, all sources, but the nested one are displayed
|
||||
await waitForSourcesInSourceTree(
|
||||
dbg,
|
||||
["doc-sources.html", "simple1.js", "simple2.js", "long.js"],
|
||||
{ noExpand: true }
|
||||
);
|
||||
|
||||
// Right key on open dir
|
||||
await pressKey(dbg, "Right");
|
||||
await assertNodeIsFocused(dbg, 3);
|
||||
|
||||
// Right key on closed dir
|
||||
await pressKey(dbg, "Right");
|
||||
await assertNodeIsFocused(dbg, 4);
|
||||
|
||||
// Left key on a open dir
|
||||
await pressKey(dbg, "Left");
|
||||
await assertNodeIsFocused(dbg, 4);
|
||||
|
||||
// Down key on a closed dir
|
||||
await pressKey(dbg, "Down");
|
||||
await assertNodeIsFocused(dbg, 4);
|
||||
|
||||
// Right key on a source
|
||||
// We are focused on the nested source and up to this point we still display only the 4 initial sources
|
||||
await waitForSourcesInSourceTree(
|
||||
dbg,
|
||||
["doc-sources.html", "simple1.js", "simple2.js", "long.js"],
|
||||
{ noExpand: true }
|
||||
);
|
||||
await pressKey(dbg, "Right");
|
||||
await assertNodeIsFocused(dbg, 4);
|
||||
// Now, the nested source is also displayed
|
||||
await waitForSourcesInSourceTree(
|
||||
dbg,
|
||||
[
|
||||
"doc-sources.html",
|
||||
"simple1.js",
|
||||
"simple2.js",
|
||||
"long.js",
|
||||
"nested-source.js",
|
||||
],
|
||||
{ noExpand: true }
|
||||
);
|
||||
|
||||
// Down key on a source
|
||||
await pressKey(dbg, "Down");
|
||||
await assertNodeIsFocused(dbg, 5);
|
||||
|
||||
// Go to bottom of tree and press down key
|
||||
await pressKey(dbg, "Down");
|
||||
await pressKey(dbg, "Down");
|
||||
await assertNodeIsFocused(dbg, 6);
|
||||
|
||||
// Up key on a source
|
||||
await pressKey(dbg, "Up");
|
||||
await assertNodeIsFocused(dbg, 5);
|
||||
|
||||
// Left key on a source
|
||||
await pressKey(dbg, "Left");
|
||||
await assertNodeIsFocused(dbg, 4);
|
||||
|
||||
// Left key on a closed dir
|
||||
// We are about to close the nested folder, the nested source is about to disappear
|
||||
await waitForSourcesInSourceTree(
|
||||
dbg,
|
||||
[
|
||||
"doc-sources.html",
|
||||
"simple1.js",
|
||||
"simple2.js",
|
||||
"long.js",
|
||||
"nested-source.js",
|
||||
],
|
||||
{ noExpand: true }
|
||||
);
|
||||
await pressKey(dbg, "Left");
|
||||
// And it disappeared
|
||||
await waitForSourcesInSourceTree(
|
||||
dbg,
|
||||
["doc-sources.html", "simple1.js", "simple2.js", "long.js"],
|
||||
{ noExpand: true }
|
||||
);
|
||||
await pressKey(dbg, "Left");
|
||||
await assertNodeIsFocused(dbg, 3);
|
||||
|
||||
// Up Key at the top of the source tree
|
||||
await pressKey(dbg, "Up");
|
||||
await assertNodeIsFocused(dbg, 2);
|
||||
});
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
// We open against a blank page and only then navigate to the test page
|
||||
// so that sources aren't GC-ed before opening the debugger.
|
||||
// When we (re)load a page while the debugger is opened, the debugger
|
||||
// will force all sources to be held in memory.
|
||||
const dbg = await initDebuggerWithAbsoluteURL("about:blank");
|
||||
|
||||
await navigateToAbsoluteURL(
|
||||
dbg,
|
||||
TEST_URL,
|
||||
"index.html",
|
||||
"script.js",
|
||||
"test-functions.js",
|
||||
"query.js?x=1",
|
||||
"query.js?x=2",
|
||||
"bundle.js",
|
||||
"original.js",
|
||||
"replaced-bundle.js",
|
||||
"removed-original.js",
|
||||
"named-eval.js"
|
||||
);
|
||||
|
||||
await waitForSourcesInSourceTree(dbg, INTEGRATION_TEST_PAGE_SOURCES);
|
||||
|
||||
info("Assert the content of the named eval");
|
||||
await selectSource(dbg, "named-eval.js");
|
||||
assertTextContentOnLine(dbg, 3, `console.log("named-eval");`);
|
||||
|
||||
info("Assert that nameless eval don't show up in the source tree");
|
||||
invokeInTab("breakInEval");
|
||||
await waitForPaused(dbg);
|
||||
await waitForSourcesInSourceTree(dbg, INTEGRATION_TEST_PAGE_SOURCES);
|
||||
await resume(dbg);
|
||||
|
||||
info("Assert the content of sources with query string");
|
||||
await selectSource(dbg, "query.js?x=1");
|
||||
const tab = findElement(dbg, "activeTab");
|
||||
is(tab.innerText, "query.js?x=1", "Tab label is query.js?x=1");
|
||||
assertTextContentOnLine(
|
||||
dbg,
|
||||
1,
|
||||
`function query() {console.log("query x=1");}`
|
||||
);
|
||||
await addBreakpoint(dbg, "query.js?x=1", 1);
|
||||
assertBreakpointHeading(dbg, "query.js?x=1", 0);
|
||||
|
||||
// pretty print the source and check the tab text
|
||||
clickElement(dbg, "prettyPrintButton");
|
||||
await waitForSource(dbg, "query.js?x=1:formatted");
|
||||
await waitForSelectedSource(dbg, "query.js?x=1:formatted");
|
||||
|
||||
const prettyTab = findElement(dbg, "activeTab");
|
||||
is(prettyTab.innerText, "query.js?x=1", "Tab label is query.js?x=1");
|
||||
ok(prettyTab.querySelector(".img.prettyPrint"));
|
||||
assertBreakpointHeading(dbg, "query.js?x=1", 0);
|
||||
assertTextContentOnLine(dbg, 1, `function query() {`);
|
||||
// Note the replacements of " by ' here:
|
||||
assertTextContentOnLine(dbg, 2, `console.log('query x=1');`);
|
||||
|
||||
// assert quick open works with queries
|
||||
pressKey(dbg, "quickOpen");
|
||||
type(dbg, "query.js?x");
|
||||
|
||||
// There can be intermediate updates in the results,
|
||||
// so wait for the final expected value
|
||||
await waitFor(async () => {
|
||||
const resultItem = findElement(dbg, "resultItems");
|
||||
if (!resultItem) {
|
||||
return false;
|
||||
}
|
||||
return resultItem.innerText.includes("query.js?x=1");
|
||||
}, "Results include the source with the query string");
|
||||
});
|
||||
|
||||
/**
|
||||
* Verify that Web Extension content scripts appear only when
|
||||
* devtools.chrome.enabled is set to true and that they get
|
||||
* automatically re-selected on page reload.
|
||||
*/
|
||||
add_task(async function testSourceTreeWithWebExtensionContentScript() {
|
||||
const extension = await installAndStartContentScriptExtension();
|
||||
|
||||
info("Without the chrome preference, the content script doesn't show up");
|
||||
await pushPref("devtools.chrome.enabled", false);
|
||||
let dbg = await initDebugger("doc-content-script-sources.html");
|
||||
// Let some time for unexpected source to appear
|
||||
await wait(1000);
|
||||
// Bug 1761975 - While the content script doesn't show up,
|
||||
// the internals of WebExtension codebase appear in the debugger...
|
||||
await waitForSourcesInSourceTree(dbg, ["ExtensionContent.jsm"]);
|
||||
await dbg.toolbox.closeToolbox();
|
||||
|
||||
info("With the chrome preference, the content script shows up");
|
||||
await pushPref("devtools.chrome.enabled", true);
|
||||
const toolbox = await openToolboxForTab(gBrowser.selectedTab, "jsdebugger");
|
||||
dbg = createDebuggerContext(toolbox);
|
||||
await waitForSourcesInSourceTree(dbg, [
|
||||
"content_script.js",
|
||||
"ExtensionContent.jsm",
|
||||
]);
|
||||
await selectSource(dbg, "content_script.js");
|
||||
ok(
|
||||
findElementWithSelector(dbg, ".sources-list .focused"),
|
||||
"Source is focused"
|
||||
);
|
||||
for (let i = 1; i < 3; i++) {
|
||||
info(
|
||||
`Reloading tab (${i} time), the content script should always be reselected`
|
||||
);
|
||||
gBrowser.reloadTab(gBrowser.selectedTab);
|
||||
await waitForSelectedSource(dbg, "content_script.js");
|
||||
ok(
|
||||
findElementWithSelector(dbg, ".sources-list .focused"),
|
||||
"Source is focused"
|
||||
);
|
||||
}
|
||||
await dbg.toolbox.closeToolbox();
|
||||
|
||||
await extension.unload();
|
||||
});
|
||||
|
||||
/**
|
||||
* Return the text content for a given line in the Source Tree.
|
||||
*
|
||||
* @param {Object} dbg
|
||||
* @param {Number} index
|
||||
* Line number in the source tree
|
||||
*/
|
||||
function getLabel(dbg, index) {
|
||||
return (
|
||||
findElement(dbg, "sourceNode", index)
|
||||
.textContent.trim()
|
||||
// There is some special whitespace character which aren't removed by trim()
|
||||
.replace(/^[\s\u200b]*/g, "")
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert the location displayed in the breakpoint list, in the right sidebar.
|
||||
*
|
||||
* @param {Object} dbg
|
||||
* @param {String} label
|
||||
* The expected displayed location
|
||||
* @param {Number} index
|
||||
* The position of the breakpoint in the list to verify
|
||||
*/
|
||||
function assertBreakpointHeading(dbg, label, index) {
|
||||
const breakpointHeading = findAllElements(dbg, "breakpointHeadings")[index]
|
||||
.innerText;
|
||||
is(breakpointHeading, label, `Breakpoint heading is ${label}`);
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Test keyboard arrow behaviour on the SourceTree with a nested folder
|
||||
* that we manually expand/collapse via arrow keys.
|
||||
*/
|
||||
add_task(async function() {
|
||||
const dbg = await initDebugger(
|
||||
"doc-sources.html",
|
||||
"simple1.js",
|
||||
"simple2.js",
|
||||
"nested-source.js",
|
||||
"long.js"
|
||||
);
|
||||
|
||||
// Before clicking on the source label, no source is displayed
|
||||
await waitForSourcesInSourceTree(dbg, [], { noExpand: true });
|
||||
await clickElement(dbg, "sourceDirectoryLabel", 3);
|
||||
// Right after, all sources, but the nested one are displayed
|
||||
await waitForSourcesInSourceTree(
|
||||
dbg,
|
||||
["doc-sources.html", "simple1.js", "simple2.js", "long.js"],
|
||||
{ noExpand: true }
|
||||
);
|
||||
|
||||
// Right key on open dir
|
||||
await pressKey(dbg, "Right");
|
||||
await assertNodeIsFocused(dbg, 3);
|
||||
|
||||
// Right key on closed dir
|
||||
await pressKey(dbg, "Right");
|
||||
await assertNodeIsFocused(dbg, 4);
|
||||
|
||||
// Left key on a open dir
|
||||
await pressKey(dbg, "Left");
|
||||
await assertNodeIsFocused(dbg, 4);
|
||||
|
||||
// Down key on a closed dir
|
||||
await pressKey(dbg, "Down");
|
||||
await assertNodeIsFocused(dbg, 4);
|
||||
|
||||
// Right key on a source
|
||||
// We are focused on the nested source and up to this point we still display only the 4 initial sources
|
||||
await waitForSourcesInSourceTree(
|
||||
dbg,
|
||||
["doc-sources.html", "simple1.js", "simple2.js", "long.js"],
|
||||
{ noExpand: true }
|
||||
);
|
||||
await pressKey(dbg, "Right");
|
||||
await assertNodeIsFocused(dbg, 4);
|
||||
// Now, the nested source is also displayed
|
||||
await waitForSourcesInSourceTree(
|
||||
dbg,
|
||||
[
|
||||
"doc-sources.html",
|
||||
"simple1.js",
|
||||
"simple2.js",
|
||||
"long.js",
|
||||
"nested-source.js",
|
||||
],
|
||||
{ noExpand: true }
|
||||
);
|
||||
|
||||
// Down key on a source
|
||||
await pressKey(dbg, "Down");
|
||||
await assertNodeIsFocused(dbg, 5);
|
||||
|
||||
// Go to bottom of tree and press down key
|
||||
await pressKey(dbg, "Down");
|
||||
await pressKey(dbg, "Down");
|
||||
await assertNodeIsFocused(dbg, 6);
|
||||
|
||||
// Up key on a source
|
||||
await pressKey(dbg, "Up");
|
||||
await assertNodeIsFocused(dbg, 5);
|
||||
|
||||
// Left key on a source
|
||||
await pressKey(dbg, "Left");
|
||||
await assertNodeIsFocused(dbg, 4);
|
||||
|
||||
// Left key on a closed dir
|
||||
// We are about to close the nested folder, the nested source is about to disappear
|
||||
await waitForSourcesInSourceTree(
|
||||
dbg,
|
||||
[
|
||||
"doc-sources.html",
|
||||
"simple1.js",
|
||||
"simple2.js",
|
||||
"long.js",
|
||||
"nested-source.js",
|
||||
],
|
||||
{ noExpand: true }
|
||||
);
|
||||
await pressKey(dbg, "Left");
|
||||
// And it disappeared
|
||||
await waitForSourcesInSourceTree(
|
||||
dbg,
|
||||
["doc-sources.html", "simple1.js", "simple2.js", "long.js"],
|
||||
{ noExpand: true }
|
||||
);
|
||||
await pressKey(dbg, "Left");
|
||||
await assertNodeIsFocused(dbg, 3);
|
||||
|
||||
// Up Key at the top of the source tree
|
||||
await pressKey(dbg, "Up");
|
||||
await assertNodeIsFocused(dbg, 2);
|
||||
});
|
@ -0,0 +1,52 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
// Make sure named eval sources appear in the Debugger
|
||||
// and we show proper source text content
|
||||
|
||||
"use strict";
|
||||
|
||||
add_task(async function() {
|
||||
const dbg = await initDebugger(
|
||||
"doc-sources.html",
|
||||
"simple1.js",
|
||||
"simple2.js",
|
||||
"nested-source.js",
|
||||
"long.js"
|
||||
);
|
||||
|
||||
info("Assert that all page sources appear in the source tree");
|
||||
await waitForSourcesInSourceTree(dbg, [
|
||||
"doc-sources.html",
|
||||
"simple1.js",
|
||||
"simple2.js",
|
||||
"nested-source.js",
|
||||
"long.js",
|
||||
]);
|
||||
|
||||
info(`>>> contentTask: evaluate evaled.js`);
|
||||
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], function() {
|
||||
content.eval(
|
||||
`window.evaledFunc = function() {};
|
||||
//# sourceURL=evaled.js
|
||||
`
|
||||
);
|
||||
});
|
||||
|
||||
info("Assert that the evaled source appear in the source tree");
|
||||
await waitForSourcesInSourceTree(dbg, [
|
||||
"doc-sources.html",
|
||||
"simple1.js",
|
||||
"simple2.js",
|
||||
"nested-source.js",
|
||||
"long.js",
|
||||
"evaled.js",
|
||||
]);
|
||||
|
||||
info("Wait for the evaled source");
|
||||
await waitForSource(dbg, "evaled.js");
|
||||
await selectSource(dbg, "evaled.js");
|
||||
|
||||
assertTextContentOnLine(dbg, 1, "window.evaledFunc = function() {};");
|
||||
});
|
@ -0,0 +1,61 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
// /!\ This test is currently skiped and fails in many ways /!\
|
||||
|
||||
// Tests that the source tree works with sources having query strings
|
||||
|
||||
"use strict";
|
||||
|
||||
add_task(async function() {
|
||||
const dbg = await initDebugger(
|
||||
"doc-sources-querystring.html",
|
||||
"simple1.js?x=1",
|
||||
"simple1.js?x=2"
|
||||
);
|
||||
|
||||
// Expand nodes and make sure the two sources appear.
|
||||
await waitForSourcesInSourceTree(dbg, [], { noExpand: true });
|
||||
await clickElement(dbg, "sourceDirectoryLabel", 3);
|
||||
await waitForSourcesInSourceTree(dbg, ["simple1.js?x=1", "simple1.js?x=2"], {
|
||||
noExpand: true,
|
||||
});
|
||||
|
||||
is(getLabel(dbg, 4), "simple1.js?x=1", "simple1.js?x=1 exists");
|
||||
is(getLabel(dbg, 5), "simple1.js?x=2", "simple1.js?x=2 exists");
|
||||
|
||||
await selectSource(dbg, "simple1.js?x=1");
|
||||
const tab = findElement(dbg, "activeTab");
|
||||
is(tab.innerText, "simple1.js?x=1", "Tab label is simple1.js?x=1");
|
||||
await addBreakpoint(dbg, "simple1.js?x=1", 6);
|
||||
assertBreakpointHeading(dbg, "simple1.js?x=1", 0);
|
||||
|
||||
// pretty print the source and check the tab text
|
||||
clickElement(dbg, "prettyPrintButton");
|
||||
await waitForSource(dbg, "simple1.js?x=1:formatted");
|
||||
|
||||
const prettyTab = findElement(dbg, "activeTab");
|
||||
is(prettyTab.innerText, "simple1.js?x=1", "Tab label is simple1.js?x=1");
|
||||
// /!\ this test is skiped and this assertion fails:
|
||||
ok(prettyTab.querySelector("img.prettyPrint"));
|
||||
assertBreakpointHeading(dbg, "simple1.js?x=1", 0);
|
||||
|
||||
// assert quick open works with queries
|
||||
pressKey(dbg, "quickOpen");
|
||||
type(dbg, "simple1.js?x");
|
||||
// /!\ this test is skiped and this assertion fails:
|
||||
ok(findElement(dbg, "resultItems")[0].innerText.includes("simple.js?x=1"));
|
||||
});
|
||||
|
||||
function getLabel(dbg, index) {
|
||||
return findElement(dbg, "sourceNode", index)
|
||||
.textContent.trim()
|
||||
.replace(/^[\s\u200b]*/g, "");
|
||||
}
|
||||
|
||||
function assertBreakpointHeading(dbg, label, index) {
|
||||
const breakpointHeading = findAllElements(dbg, "breakpointHeadings")[index]
|
||||
.innerText;
|
||||
is(breakpointHeading, label, `Breakpoint heading is ${label}`);
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
// Tests that the source tree works.
|
||||
|
||||
"use strict";
|
||||
|
||||
add_task(async function() {
|
||||
const dbg = await initDebugger(
|
||||
"doc-sources.html",
|
||||
"simple1.js",
|
||||
"simple2.js",
|
||||
"nested-source.js",
|
||||
"long.js"
|
||||
);
|
||||
const {
|
||||
selectors: { getSelectedSource },
|
||||
} = dbg;
|
||||
|
||||
// Expand nodes and make sure more sources appear.
|
||||
is(
|
||||
findElement(dbg, "sourceNode", 1).textContent.trim(),
|
||||
"Main Thread",
|
||||
"Main thread is labeled properly"
|
||||
);
|
||||
info("Before interacting with the source tree, no source are displayed");
|
||||
await waitForSourcesInSourceTree(dbg, [], { noExpand: true });
|
||||
await clickElement(dbg, "sourceDirectoryLabel", 3);
|
||||
info(
|
||||
"After clicking on the directory, all sources but the nested one are displayed"
|
||||
);
|
||||
await waitForSourcesInSourceTree(
|
||||
dbg,
|
||||
["doc-sources.html", "simple1.js", "simple2.js", "long.js"],
|
||||
{ noExpand: true }
|
||||
);
|
||||
|
||||
await clickElement(dbg, "sourceDirectoryLabel", 4);
|
||||
info(
|
||||
"After clicing on the nested directory, the nested source is also displayed"
|
||||
);
|
||||
await waitForSourcesInSourceTree(
|
||||
dbg,
|
||||
[
|
||||
"doc-sources.html",
|
||||
"simple1.js",
|
||||
"simple2.js",
|
||||
"long.js",
|
||||
"nested-source.js",
|
||||
],
|
||||
{ noExpand: true }
|
||||
);
|
||||
|
||||
const selected = waitForDispatch(dbg.store, "SET_SELECTED_LOCATION");
|
||||
await clickElement(dbg, "sourceNode", 5);
|
||||
await selected;
|
||||
await waitForSelectedSource(dbg, "nested-source.js");
|
||||
|
||||
// Ensure the source file clicked is now focused
|
||||
await waitForElementWithSelector(dbg, ".sources-list .focused");
|
||||
|
||||
const fourthNode = findElement(dbg, "sourceNode", 5);
|
||||
const selectedSource = getSelectedSource().url;
|
||||
|
||||
ok(fourthNode.classList.contains("focused"), "4th node is focused");
|
||||
ok(selectedSource.includes("nested-source.js"), "nested-source is selected");
|
||||
await assertNodeIsFocused(dbg, 5);
|
||||
|
||||
// Make sure new sources appear in the list.
|
||||
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], function() {
|
||||
const script = content.document.createElement("script");
|
||||
script.src = "math.min.js";
|
||||
content.document.body.appendChild(script);
|
||||
});
|
||||
|
||||
info("After adding math.min.js, we got a new source displayed");
|
||||
await waitForSourcesInSourceTree(
|
||||
dbg,
|
||||
[
|
||||
"doc-sources.html",
|
||||
"simple1.js",
|
||||
"simple2.js",
|
||||
"long.js",
|
||||
"nested-source.js",
|
||||
"math.min.js",
|
||||
],
|
||||
{ noExpand: true }
|
||||
);
|
||||
await assertNodeIsFocused(dbg, 5);
|
||||
is(
|
||||
getSourceNodeLabel(dbg, 8),
|
||||
"math.min.js",
|
||||
"math.min.js - The dynamic script exists"
|
||||
);
|
||||
});
|
@ -3,50 +3,19 @@
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<script src="script.js"></script>
|
||||
<script src="bundle.js"></script>
|
||||
<script src="replaced-bundle.js"></script>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Empty test page 1</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- A simple inline script, that helps to cover breakable lines/columns -->
|
||||
<!-- Have them define first, so that we avoid shifting lines when adding new scripts later in the html -->
|
||||
<script>
|
||||
// Comment
|
||||
console.log('breakable-line');
|
||||
</script>
|
||||
|
||||
<!-- A second inline script, that helps cover bugs when having two distinct inline scripts -->
|
||||
<script>
|
||||
console.log("second in line script");
|
||||
|
||||
eval(`
|
||||
function nameLessEval() {
|
||||
console.log("name-less-eval");
|
||||
}
|
||||
`);
|
||||
eval(`
|
||||
function namedEval() {
|
||||
console.log("named-eval");
|
||||
}
|
||||
//# sourceURL=named-eval.js
|
||||
`);
|
||||
</script>
|
||||
|
||||
<!-- A simple script -->
|
||||
<script src="script.js"></script>
|
||||
<!-- Another script containing helper functions trigerred by the tests -->
|
||||
<script src="test-functions.js"></script>
|
||||
|
||||
<!-- Scripts with query strings, which are merged in the SourceTree -->
|
||||
<script src="query.js?x=1"></script>
|
||||
<script src="query.js?x=2"></script>
|
||||
|
||||
<!-- A bundle/generated source that contains original.js -->
|
||||
<script src="bundle.js"></script>
|
||||
|
||||
<!-- Another bundle/generated source that contains removed-original.js -->
|
||||
<script src="replaced-bundle.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -1 +0,0 @@
|
||||
function query() {console.log("query x=1");}
|
@ -1 +0,0 @@
|
||||
function query() {console.log("query x=2");}
|
@ -1,5 +1,5 @@
|
||||
// Add two comment lines, to match the one from v2/new-original.js and have same....
|
||||
// breakpoint column positions.......................
|
||||
// Add two comment lines, to match the one from new-original.js and have same
|
||||
// breakpoint positions..............................
|
||||
window.removedOriginal = function removedOriginal() {
|
||||
console.log("Removed original");
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./removed-original.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","removedOriginal","console","log"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,gDChFrDC,OAAOC,gBAAkB,WACvBC,QAAQC,IAAI","file":"replaced-bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","// Add two comment lines, to match the one from v2/new-original.js and have same....\n// breakpoint column positions.......................\nwindow.removedOriginal = function removedOriginal() {\n console.log(\"Removed original\");\n}\n"],"sourceRoot":""}
|
||||
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./removed-original.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","removedOriginal","console","log"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,gDChFrDC,OAAOC,gBAAkB,WACvBC,QAAQC,IAAI","file":"replaced-bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","// Add two comment lines, to match the one from new-original.js and have same\n// breakpoint positions..............................\nwindow.removedOriginal = function removedOriginal() {\n console.log(\"Removed original\");\n}\n"],"sourceRoot":""}
|
@ -1,14 +0,0 @@
|
||||
/**
|
||||
* This file contains various test functions called by the test script via `await invokeInTab("functionName");`.
|
||||
*/
|
||||
function breakInEval() {
|
||||
eval(`
|
||||
debugger;
|
||||
|
||||
window.evaledFunc = function() {
|
||||
var foo = 1;
|
||||
var bar = 2;
|
||||
return foo + bar;
|
||||
};
|
||||
`);
|
||||
}
|
@ -3,13 +3,8 @@
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<!-- A simple script -->
|
||||
<script src="script.js"></script>
|
||||
|
||||
<!-- A bundle/generated source that contains an updated version of original.js -->
|
||||
<script src="bundle.js"></script>
|
||||
|
||||
<!-- Another bundle/generated source that contains new-original.js which replaced the content of removed-original.js -->
|
||||
<script src="replaced-bundle.js"></script>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
@ -17,7 +12,6 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- A simple inline script, that helps to cover breakable lines/columns -->
|
||||
<script>
|
||||
console.log('breakable-line');
|
||||
// Comment
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Pad the name with "_" in order to match the same length as v1/removed-original.js
|
||||
// Pad the name with "_" in order to match the same length as removedOriginal
|
||||
// and set the column breakpoints on the same column!
|
||||
window.____newOriginal = function ____newOriginal() {
|
||||
console.log("New original");
|
||||
|
File diff suppressed because one or more lines are too long
@ -3,9 +3,8 @@
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<!-- A bundle/generated source that contains yet another version of original.js -->
|
||||
<script src="script.js"></script>
|
||||
<script src="bundle.js"></script>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Empty test page 3</title>
|
||||
|
@ -0,0 +1 @@
|
||||
// empty file
|
@ -3,50 +3,19 @@
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<script src="script.js"></script>
|
||||
<script src="bundle.js"></script>
|
||||
<script src="replaced-bundle.js"></script>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Empty test page 1</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- A simple inline script, that helps to cover breakable lines/columns -->
|
||||
<!-- Have them define first, so that we avoid shifting lines when adding new scripts later in the html -->
|
||||
<script>
|
||||
// Comment
|
||||
console.log('breakable-line');
|
||||
</script>
|
||||
|
||||
<!-- A second inline script, that helps cover bugs when having two distinct inline scripts -->
|
||||
<script>
|
||||
console.log("second in line script");
|
||||
|
||||
eval(`
|
||||
function nameLessEval() {
|
||||
console.log("name-less-eval");
|
||||
}
|
||||
`);
|
||||
eval(`
|
||||
function namedEval() {
|
||||
console.log("named-eval");
|
||||
}
|
||||
//# sourceURL=named-eval.js
|
||||
`);
|
||||
</script>
|
||||
|
||||
<!-- A simple script -->
|
||||
<script src="script.js"></script>
|
||||
<!-- Another script containing helper functions trigerred by the tests -->
|
||||
<script src="test-functions.js"></script>
|
||||
|
||||
<!-- Scripts with query strings, which are merged in the SourceTree -->
|
||||
<script src="query.js?x=1"></script>
|
||||
<script src="query.js?x=2"></script>
|
||||
|
||||
<!-- A bundle/generated source that contains original.js -->
|
||||
<script src="bundle.js"></script>
|
||||
|
||||
<!-- Another bundle/generated source that contains removed-original.js -->
|
||||
<script src="replaced-bundle.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -1 +0,0 @@
|
||||
function query() {console.log("query x=1");}
|
@ -1 +0,0 @@
|
||||
function query() {console.log("query x=2");}
|
@ -1,5 +1,5 @@
|
||||
// Add two comment lines, to match the one from v2/new-original.js and have same....
|
||||
// breakpoint column positions.......................
|
||||
// Add two comment lines, to match the one from new-original.js and have same
|
||||
// breakpoint positions..............................
|
||||
window.removedOriginal = function removedOriginal() {
|
||||
console.log("Removed original");
|
||||
}
|
||||
|
@ -74,8 +74,8 @@ module.exports = __webpack_require__(1);
|
||||
/* 1 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
// Add two comment lines, to match the one from v2/new-original.js and have same....
|
||||
// breakpoint column positions.......................
|
||||
// Add two comment lines, to match the one from new-original.js and have same
|
||||
// breakpoint positions..............................
|
||||
window.removedOriginal = function removedOriginal() {
|
||||
console.log("Removed original");
|
||||
};
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"sources":["webpack:///webpack/bootstrap 3b1a221408fdde86aa49","webpack:///./removed-original.js"],"names":["window","removedOriginal","console","log"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,KAAK;QACL;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;QAEA;QACA;;;;;;;;;;;;;;AC7DA;AACA;AACAA,OAAOC,eAAP,GAAyB,SAASA,eAAT,GAA2B;AAClDC,UAAQC,GAAR,CAAY,kBAAZ;AACD,CAFD,C","file":"replaced-bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 3b1a221408fdde86aa49","// Add two comment lines, to match the one from v2/new-original.js and have same....\n// breakpoint column positions.......................\nwindow.removedOriginal = function removedOriginal() {\n console.log(\"Removed original\");\n}\n\n\n\n// WEBPACK FOOTER //\n// ./removed-original.js"],"sourceRoot":""}
|
||||
{"version":3,"sources":["webpack:///webpack/bootstrap 450f2ed5071212525ef7","webpack:///./removed-original.js"],"names":["window","removedOriginal","console","log"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,KAAK;QACL;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;QAEA;QACA;;;;;;;;;;;;;;AC7DA;AACA;AACAA,OAAOC,eAAP,GAAyB,SAASA,eAAT,GAA2B;AAClDC,UAAQC,GAAR,CAAY,kBAAZ;AACD,CAFD,C","file":"replaced-bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 450f2ed5071212525ef7","// Add two comment lines, to match the one from new-original.js and have same\n// breakpoint positions..............................\nwindow.removedOriginal = function removedOriginal() {\n console.log(\"Removed original\");\n}\n\n\n\n// WEBPACK FOOTER //\n// ./removed-original.js"],"sourceRoot":""}
|
@ -1,14 +0,0 @@
|
||||
/**
|
||||
* This file contains various test functions called by the test script via `await invokeInTab("functionName");`.
|
||||
*/
|
||||
function breakInEval() {
|
||||
eval(`
|
||||
debugger;
|
||||
|
||||
window.evaledFunc = function() {
|
||||
var foo = 1;
|
||||
var bar = 2;
|
||||
return foo + bar;
|
||||
};
|
||||
`);
|
||||
}
|
@ -3,13 +3,8 @@
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<!-- A simple script -->
|
||||
<script src="script.js"></script>
|
||||
|
||||
<!-- A bundle/generated source that contains an updated version of original.js -->
|
||||
<script src="bundle.js"></script>
|
||||
|
||||
<!-- Another bundle/generated source that contains new-original.js which replaced the content of removed-original.js -->
|
||||
<script src="replaced-bundle.js"></script>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
@ -17,7 +12,6 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- A simple inline script, that helps to cover breakable lines/columns -->
|
||||
<script>
|
||||
console.log('breakable-line');
|
||||
// Comment
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Pad the name with "_" in order to match the same length as v1/removed-original.js
|
||||
// Pad the name with "_" in order to match the same length as removedOriginal
|
||||
// and set the column breakpoints on the same column!
|
||||
window.____newOriginal = function ____newOriginal() {
|
||||
console.log("New original");
|
||||
|
@ -74,7 +74,7 @@ module.exports = __webpack_require__(1);
|
||||
/* 1 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
// Pad the name with "_" in order to match the same length as v1/removed-original.js
|
||||
// Pad the name with "_" in order to match the same length as removedOriginal
|
||||
// and set the column breakpoints on the same column!
|
||||
window.____newOriginal = function ____newOriginal() {
|
||||
console.log("New original");
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"sources":["webpack:///webpack/bootstrap 94a35eb61033f6e1078b","webpack:///./new-original.js"],"names":["window","____newOriginal","console","log"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,KAAK;QACL;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;QAEA;QACA;;;;;;;;;;;;;;AC7DA;AACA;AACAA,OAAOC,eAAP,GAAyB,SAASA,eAAT,GAA2B;AAClDC,UAAQC,GAAR,CAAY,cAAZ;AACD,CAFD;AAGAH,OAAOC,eAAP,G","file":"replaced-bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 94a35eb61033f6e1078b","// Pad the name with \"_\" in order to match the same length as v1/removed-original.js\n// and set the column breakpoints on the same column!\nwindow.____newOriginal = function ____newOriginal() {\n console.log(\"New original\");\n}\nwindow.____newOriginal();\n\n\n\n// WEBPACK FOOTER //\n// ./new-original.js"],"sourceRoot":""}
|
||||
{"version":3,"sources":["webpack:///webpack/bootstrap 70ef17637fbc0da592a3","webpack:///./new-original.js"],"names":["window","____newOriginal","console","log"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,KAAK;QACL;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;QAEA;QACA;;;;;;;;;;;;;;AC7DA;AACA;AACAA,OAAOC,eAAP,GAAyB,SAASA,eAAT,GAA2B;AAClDC,UAAQC,GAAR,CAAY,cAAZ;AACD,CAFD;AAGAH,OAAOC,eAAP,G","file":"replaced-bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 70ef17637fbc0da592a3","// Pad the name with \"_\" in order to match the same length as removedOriginal\n// and set the column breakpoints on the same column!\nwindow.____newOriginal = function ____newOriginal() {\n console.log(\"New original\");\n}\nwindow.____newOriginal();\n\n\n\n// WEBPACK FOOTER //\n// ./new-original.js"],"sourceRoot":""}
|
@ -3,9 +3,8 @@
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<!-- A bundle/generated source that contains yet another version of original.js -->
|
||||
<script src="script.js"></script>
|
||||
<script src="bundle.js"></script>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Empty test page 3</title>
|
||||
|
@ -0,0 +1 @@
|
||||
// empty file
|
@ -96,39 +96,3 @@ async function runAllIntegrationTests(testFolder, env) {
|
||||
await task(testServer, testUrl, env);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Install a Web Extension which will run a content script against any test page
|
||||
* served from https://example.com
|
||||
*
|
||||
* This content script is meant to be debuggable when devtools.chrome.enabled is true.
|
||||
*/
|
||||
async function installAndStartContentScriptExtension() {
|
||||
function contentScript() {
|
||||
console.log("content script loads");
|
||||
|
||||
// This listener prevents the source from being garbage collected
|
||||
// and be missing from the scripts returned by `dbg.findScripts()`
|
||||
// in `ThreadActor._discoverSources`.
|
||||
window.onload = () => {};
|
||||
}
|
||||
|
||||
const extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
content_scripts: [
|
||||
{
|
||||
js: ["content_script.js"],
|
||||
matches: ["https://example.com/*"],
|
||||
run_at: "document_start",
|
||||
},
|
||||
],
|
||||
},
|
||||
files: {
|
||||
"content_script.js": contentScript,
|
||||
},
|
||||
});
|
||||
|
||||
await extension.startup();
|
||||
|
||||
return extension;
|
||||
}
|
||||
|
@ -7,13 +7,6 @@
|
||||
/**
|
||||
* This first test will focus on original.js file whose content changes
|
||||
* which affects the related generated file: bundle.js
|
||||
*
|
||||
* In the first reload, v2/original.js will only change with new lines being added
|
||||
* before the line where we set a breakpoint. So that the breakpoint, if not
|
||||
* automatically shifted, will now be against an empty line.
|
||||
*
|
||||
* In the second reload, v3/original.js will be trimmed, so that the line
|
||||
* where we set a breakpoint against, has been removed.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
@ -5,15 +5,11 @@
|
||||
/* import-globals-from ../head.js */
|
||||
|
||||
/**
|
||||
* This second test will focus on v1/removed-original.js which is an original source mapped file.
|
||||
* This second test will focus on removed-original.js which is an original source mapped file.
|
||||
* This source is mapped to replaced-bundle.js.
|
||||
* In the first reload (v2), this original source is removed and another original file: v2/new-original.js
|
||||
* This original source is removed and another original file: new-original.js
|
||||
* will replace the content of the removed-original.js in the replaced-bundle.js generated file.
|
||||
* And finally, in the second reload (v3) everything is removed, both original and generated source.
|
||||
*
|
||||
* Note that great care is done to ensure that new-original replaces removed-original with the
|
||||
* exact same breakable lines and columns. So that the breakpoint isn't simply removed
|
||||
* because the location is no longer breakable.
|
||||
* And finally, everything is removed, both original and generated source.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
@ -2002,6 +2002,7 @@ async function expandSourceTree(dbg) {
|
||||
);
|
||||
for (const rootNode of rootNodes) {
|
||||
await expandAllSourceNodes(dbg, rootNode);
|
||||
await wait(250);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2018,51 +2019,21 @@ async function waitForSourcesInSourceTree(
|
||||
{ noExpand = false } = {}
|
||||
) {
|
||||
info(`waiting for ${sources.length} files in the source tree`);
|
||||
function getDisplayedSources() {
|
||||
await waitFor(async () => {
|
||||
if (!noExpand) {
|
||||
await expandSourceTree(dbg);
|
||||
}
|
||||
// Replace some non visible space characters that prevents Array.includes from working correctly
|
||||
return [...findAllElements(dbg, "sourceTreeFiles")].map(e => {
|
||||
return e.textContent.trim().replace(/^[\s\u200b]*/g, "");
|
||||
});
|
||||
}
|
||||
try {
|
||||
// Use custom timeout and retry count for waitFor as the test method is slow to resolve
|
||||
// and default value makes the timeout unecessarily long
|
||||
await waitFor(
|
||||
async () => {
|
||||
if (!noExpand) {
|
||||
await expandSourceTree(dbg);
|
||||
}
|
||||
const displayedSources = getDisplayedSources();
|
||||
return (
|
||||
displayedSources.length == sources.length &&
|
||||
sources.every(source => displayedSources.includes(source))
|
||||
);
|
||||
},
|
||||
null,
|
||||
100,
|
||||
50
|
||||
);
|
||||
} catch (e) {
|
||||
// Craft a custom error message to help understand what's wrong with the Source Tree content
|
||||
const displayedSources = getDisplayedSources();
|
||||
let msg = "Invalid Source Tree Content.\n";
|
||||
const missingElements = [];
|
||||
for (const source of sources) {
|
||||
const idx = displayedSources.indexOf(source);
|
||||
if (idx != -1) {
|
||||
displayedSources.splice(idx, 1);
|
||||
} else {
|
||||
missingElements.push(source);
|
||||
const displayedSources = [...findAllElements(dbg, "sourceTreeFiles")].map(
|
||||
e => {
|
||||
return e.textContent.trim().replace(/^[\s\u200b]*/g, "");
|
||||
}
|
||||
}
|
||||
if (missingElements.length > 0) {
|
||||
msg += "Missing elements: " + missingElements.join(", ") + "\n";
|
||||
}
|
||||
if (displayedSources.length > 0) {
|
||||
msg += "Unexpected elements: " + displayedSources.join(", ");
|
||||
}
|
||||
throw new Error(msg);
|
||||
}
|
||||
);
|
||||
return (
|
||||
displayedSources.length == sources.length &&
|
||||
sources.every(source => displayedSources.includes(source))
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
async function waitForNodeToGainFocus(dbg, index) {
|
||||
@ -2330,22 +2301,6 @@ function createVersionizedHttpTestServer(testFolderName) {
|
||||
if (request.path == "/" || request.path == "/index.html") {
|
||||
response.setHeader("Content-Type", "text/html");
|
||||
}
|
||||
// If a query string is passed, lookup with a matching file, if available
|
||||
// The '?' is replaced by '.'
|
||||
if (request.queryString) {
|
||||
const url = `${URL_ROOT}${testFolderName}/v${currentVersion}${request.path}.${request.queryString}`;
|
||||
try {
|
||||
const content = await fetch(url);
|
||||
// Log this only if the request succeed
|
||||
info(`[test-http-server] serving: ${url}`);
|
||||
const text = await content.text();
|
||||
response.write(text);
|
||||
response.finish();
|
||||
return;
|
||||
} catch (e) {
|
||||
// Ignore any error and proceed without the query string
|
||||
}
|
||||
}
|
||||
const url = `${URL_ROOT}${testFolderName}/v${currentVersion}${request.path}`;
|
||||
info(`[test-http-server] serving: ${url}`);
|
||||
const content = await fetch(url);
|
||||
|
Loading…
Reference in New Issue
Block a user