forked from BrowserWorks/Waterfox
-
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.
Bug 1538397 - Don't use source actor for event listeners with mapped …
…sources, r=ochameau. --HG-- extra : histedit_source : ff5792d263f849c3a8255371e5570cd842f02a05%2C2fba09ffff23dd9d0901aaabad74c6a1708a30da
- Loading branch information
1 parent
1f1d943
commit 199bb29
Showing
5 changed files
with
67 additions
and
1 deletion.
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
48 changes: 48 additions & 0 deletions
48
devtools/client/inspector/markup/test/browser_markup_view-original-source.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,48 @@ | ||
/* -*- 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/ */ | ||
|
||
"use strict"; | ||
|
||
const TEST_URI = URL_ROOT + "doc_markup_view-original-source.html"; | ||
|
||
// Test that event handler links go to the right debugger source when the | ||
// event handler is source mapped. | ||
add_task(async function() { | ||
const { inspector, toolbox } = await openInspectorForURL(TEST_URI); | ||
|
||
const target = await TargetFactory.forTab(gBrowser.selectedTab); | ||
|
||
const nodeFront = await getNodeFront("#foo", inspector); | ||
const container = getContainerForNodeFront(nodeFront, inspector); | ||
|
||
const evHolder = container.elt.querySelector( | ||
".inspector-badge.interactive[data-event]"); | ||
|
||
evHolder.scrollIntoView(); | ||
EventUtils.synthesizeMouseAtCenter(evHolder, {}, | ||
inspector.markup.doc.defaultView); | ||
|
||
const tooltip = inspector.markup.eventDetailsTooltip; | ||
await tooltip.once("shown"); | ||
await tooltip.once("event-tooltip-source-map-ready"); | ||
|
||
const debuggerIcon = tooltip.panel.querySelector(".event-tooltip-debugger-icon"); | ||
EventUtils.synthesizeMouse(debuggerIcon, 2, 2, {}, debuggerIcon.ownerGlobal); | ||
|
||
await gDevTools.showToolbox(target, "jsdebugger"); | ||
const dbg = toolbox.getPanel("jsdebugger"); | ||
|
||
let source; | ||
await BrowserTestUtils.waitForCondition(() => { | ||
source = dbg._selectors.getSelectedSource(dbg._getState()); | ||
return !!source; | ||
}, "loaded source", 100, 20); | ||
|
||
is( | ||
source.url, | ||
"webpack:///events_original.js", | ||
"expected original source to be loaded" | ||
); | ||
}); |
9 changes: 9 additions & 0 deletions
9
devtools/client/inspector/markup/test/doc_markup_view-original-source.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,9 @@ | ||
<body> | ||
<button id="foo">Button</button> | ||
<script src="events_bundle.js"></script> | ||
<script> | ||
"use strict"; | ||
var button = document.getElementById("foo"); | ||
button.addEventListener("click", window.init); | ||
</script> | ||
</body> |
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