forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge inbound to mozilla-central. a=merge
- Loading branch information
Showing
28 changed files
with
409 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
devtools/client/debugger/test/mochitest/browser_dbg-old-breakpoint.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* Any copyright is dedicated to the Public Domain. | ||
* http://creativecommons.org/publicdomain/zero/1.0/ */ | ||
|
||
// Test that we show a breakpoint in the UI when there is an old pending | ||
// breakpoint with an invalid original location. | ||
add_task(async function() { | ||
clearDebuggerPreferences(); | ||
|
||
const pending = { | ||
bp1: { | ||
location: { | ||
sourceId: "", | ||
sourceUrl: EXAMPLE_URL + "nowhere2.js", | ||
line: 5 | ||
}, | ||
generatedLocation: { | ||
sourceUrl: EXAMPLE_URL + "simple1.js", | ||
line: 4 | ||
}, | ||
options: {}, | ||
disabled: false | ||
}, | ||
bp2: { | ||
location: { | ||
sourceId: "", | ||
sourceUrl: EXAMPLE_URL + "nowhere.js", | ||
line: 5 | ||
}, | ||
generatedLocation: { | ||
sourceUrl: EXAMPLE_URL + "simple3.js", | ||
line: 2 | ||
}, | ||
options: {}, | ||
disabled: false | ||
}, | ||
}; | ||
asyncStorage.setItem("debugger.pending-breakpoints", pending); | ||
|
||
const toolbox = await openNewTabAndToolbox(EXAMPLE_URL + "doc-scripts.html", "jsdebugger"); | ||
const dbg = createDebuggerContext(toolbox); | ||
|
||
// Pending breakpoints are installed asynchronously, keep invoking the entry | ||
// function until the debugger pauses. | ||
await waitUntil(() => { | ||
invokeInTab("main"); | ||
return isPaused(dbg); | ||
}); | ||
|
||
ok(true, "paused at unmapped breakpoint"); | ||
await waitForState(dbg, state => dbg.selectors.getBreakpointCount(state) == 2); | ||
ok(true, "unmapped breakpoints shown in UI"); | ||
}); | ||
|
||
// Test that if we show a breakpoint with an old generated location, it is | ||
// removed after we load the original source and find the new generated | ||
// location. | ||
add_task(async function() { | ||
clearDebuggerPreferences(); | ||
|
||
const pending = { | ||
bp1: { | ||
location: { | ||
sourceId: "", | ||
sourceUrl: "webpack:///entry.js", | ||
line: 15, | ||
column: 0 | ||
}, | ||
generatedLocation: { | ||
sourceUrl: EXAMPLE_URL + "sourcemaps/bundle.js", | ||
line: 47, | ||
column: 16 | ||
}, | ||
astLocation: {}, | ||
options: {}, | ||
disabled: false | ||
}, | ||
}; | ||
asyncStorage.setItem("debugger.pending-breakpoints", pending); | ||
|
||
const toolbox = await openNewTabAndToolbox(EXAMPLE_URL + "doc-sourcemaps.html", "jsdebugger"); | ||
const dbg = createDebuggerContext(toolbox); | ||
|
||
await waitForState(dbg, state => { | ||
const bps = dbg.selectors.getBreakpointsList(state); | ||
return bps.length == 1 | ||
&& bps[0].location.sourceUrl.includes("entry.js") | ||
&& bps[0].location.line == 15; | ||
}); | ||
ok(true, "removed old breakpoint during sync"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
devtools/client/webconsole/test/mochitest/browser_webconsole_worker_error.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ | ||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ | ||
/* Any copyright is dedicated to the Public Domain. | ||
* http://creativecommons.org/publicdomain/zero/1.0/ */ | ||
|
||
// Tests that throwing uncaught errors and primitive values in workers shows a | ||
// stack in the console. | ||
|
||
"use strict"; | ||
|
||
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" + | ||
"test/mochitest/test-error-worker.html"; | ||
|
||
add_task(async function() { | ||
const hud = await openNewTabAndConsole(TEST_URI); | ||
|
||
await checkMessageStack(hud, "hello", [11, 3]); | ||
await checkMessageStack(hud, "there", [14, 3]); | ||
await checkMessageStack(hud, "dom", [16, 3]); | ||
await checkMessageStack(hud, "worker2", [6, 3]); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
devtools/client/webconsole/test/mochitest/test-error-worker.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<script> | ||
"use strict"; | ||
var w = new Worker("test-error-worker.js"); | ||
w.postMessage(1); | ||
w.postMessage(2); | ||
w.postMessage(3); | ||
</script> |
Oops, something went wrong.