Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-blackbox-ranges.html

Issue 1754483002: [DevTools] Added setBlackboxPatterns method to protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@provide-hash-for-anonymous-scripts
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-blackbox-ranges.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-blackboxed-ranges.html b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-blackbox-ranges.html
similarity index 73%
rename from third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-blackboxed-ranges.html
rename to third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-blackbox-ranges.html
index e31f5967256066e6ecd2de62c035983efa50f194..4a9ad498583b287ea4393938752ad9ba2c502456 100644
--- a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-blackboxed-ranges.html
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-blackbox-ranges.html
@@ -19,9 +19,17 @@ function foo()
<script>
function test()
{
+ var scriptIdToPattern = new Map();
+
InspectorTest.eventHandler["Debugger.paused"] = setBlackboxedScriptRanges;
+ InspectorTest.eventHandler["Debugger.scriptParsed"] = scriptParsed;
InspectorTest.sendCommandOrDie("Debugger.enable", {}, callTestFunction);
+ function scriptParsed(response)
+ {
+ scriptIdToPattern.set(response.params.scriptId, response.params.hasSourceURL ? { url: response.params.url } : { hash: response.params.hash });
dgozman 2016/03/08 18:48:12 hasSourceURL looks suspicious.
+ }
+
function callTestFunction(response)
{
InspectorTest.evaluateInInspectedPage("setTimeout(testFunction, 0);");
@@ -31,9 +39,10 @@ function test()
{
var callFrames = response.params.callFrames;
printCallFrames(callFrames);
- InspectorTest.sendCommand("Debugger.setBlackboxedRanges", {
- scriptId: callFrames[1].location.scriptId,
- positions: [ { line: 0, column: 0 } ] // blackbox ranges for blackboxed.js
+ var pattern = scriptIdToPattern.get(callFrames[1].location.scriptId);
+ pattern.positions = [ { line: 0, column: 0 } ]; // blackbox ranges for blackboxed.js
+ InspectorTest.sendCommand("Debugger.addBlackboxPatterns", {
+ patterns: [ pattern ]
}, setIncorrectRanges.bind(null, callFrames[2].location.scriptId));
}
@@ -53,18 +62,20 @@ function test()
return;
}
InspectorTest.log("Try to set positions: " + JSON.stringify(positions));
- InspectorTest.sendCommand("Debugger.setBlackboxedRanges", {
- scriptId: scriptId,
- positions: positions
+ var pattern = scriptIdToPattern.get(scriptId);
+ pattern.positions = positions;
+ InspectorTest.sendCommand("Debugger.addBlackboxPatterns", {
+ patterns: [ pattern ]
}, setIncorrectRanges.bind(null, scriptId));
}
function setMixedSourceRanges(scriptId)
{
InspectorTest.eventHandler["Debugger.paused"] = runAction;
- InspectorTest.sendCommandOrDie("Debugger.setBlackboxedRanges", {
- scriptId: scriptId,
- positions: [ { line: 8, column: 0 }, { line: 15, column: 0 } ] // blackbox ranges for mixed.js
+ var pattern = scriptIdToPattern.get(scriptId);
+ pattern.positions = [ { line: 8, column: 0 }, { line: 15, column: 0 } ]; // blackbox ranges for mixed.js
+ InspectorTest.sendCommandOrDie("Debugger.addBlackboxPatterns", {
+ patterns: [ pattern ]
}, runAction);
}

Powered by Google App Engine
This is Rietveld 408576698