forked from Floorp-Projects/Floorp
-
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 1333352 - use client-side source map service in markup view event…
… bubble; r=jdescottes MozReview-Commit-ID: D8bF5kkHp2p
- Loading branch information
Showing
9 changed files
with
237 additions
and
10 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
58 changes: 58 additions & 0 deletions
58
devtools/client/inspector/markup/test/browser_markup_events_source_map.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,58 @@ | ||
/* vim: set ts=2 et sw=2 tw=80: */ | ||
/* Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ */ | ||
|
||
"use strict"; | ||
|
||
// Check that source maps work in the event popup. | ||
|
||
const INITIAL_URL = URL_ROOT + "doc_markup_void_elements.html"; | ||
const TEST_URL = URL_ROOT + "doc_markup_events-source_map.html"; | ||
|
||
/* import-globals-from helper_events_test_runner.js */ | ||
loadHelperScript("helper_events_test_runner.js"); | ||
|
||
const TEST_DATA = [ | ||
{ | ||
selector: "#clicky", | ||
isSourceMapped: true, | ||
expected: [ | ||
{ | ||
type: "click", | ||
filename: "webpack:///events_original.js:7", | ||
attributes: [ | ||
"Bubbling", | ||
"DOM2" | ||
], | ||
handler: `function clickme() { | ||
console.log("clickme"); | ||
}`, | ||
}, | ||
], | ||
}, | ||
]; | ||
|
||
add_task(function* () { | ||
// Load some other URL before opening the toolbox, then navigate to | ||
// the test URL. This ensures that source map service will see the | ||
// sources as they are loaded, avoiding any races. | ||
let {toolbox, inspector, testActor} = yield openInspectorForURL(INITIAL_URL); | ||
|
||
// Ensure the source map service is operating. This looks a bit | ||
// funny, but sourceMapURLService is a getter, and we don't need the | ||
// result. | ||
toolbox.sourceMapURLService; | ||
|
||
yield navigateTo(inspector, TEST_URL); | ||
|
||
yield inspector.markup.expandAll(); | ||
|
||
for (let test of TEST_DATA) { | ||
yield checkEventsForNode(test, inspector, testActor); | ||
} | ||
|
||
// Wait for promises to avoid leaks when running this as a single test. | ||
// We need to do this because we have opened a bunch of popups and don't them | ||
// to affect other test runs when they are GCd. | ||
yield promiseNextTick(); | ||
}); |
10 changes: 10 additions & 0 deletions
10
devtools/client/inspector/markup/test/doc_markup_events-source_map.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,10 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<script type="application/javascript" src="events_bundle.js"></script> | ||
</head> | ||
<body onload="init();"> | ||
<div id="clicky">click here</div> | ||
</body> | ||
</html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,16 @@ | ||
/* vim: set ts=2 et sw=2 tw=80: */ | ||
/* Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ */ | ||
|
||
"use strict"; | ||
|
||
function clickme() { | ||
console.log("clickme"); | ||
} | ||
|
||
function init() { | ||
let s = document.querySelector("#clicky"); | ||
s.addEventListener("click", clickme); | ||
} | ||
|
||
window.init = init; |
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