Changeset 252730 in webkit
- Timestamp:
- Nov 21, 2019, 4:14:59 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/inspector/debugger/setShouldBlackboxURL-expected.txt (modified) (1 diff)
-
LayoutTests/inspector/debugger/setShouldBlackboxURL.html (modified) (1 diff)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r252724 r252730 1 2019-11-21 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: removing the blackbox for a specific script doesn't actually remove the blackbox 4 https://bugs.webkit.org/show_bug.cgi?id=204428 5 6 Reviewed by Timothy Hatcher. 7 8 * inspector/debugger/setShouldBlackboxURL.html: 9 * inspector/debugger/setShouldBlackboxURL-expected.txt: 10 1 11 2019-11-20 Simon Fraser <simon.fraser@apple.com> 2 12 -
trunk/LayoutTests/inspector/debugger/setShouldBlackboxURL-expected.txt
r251039 r252730 301 301 PASS: Should pause in 'CaseSensitiveRegex_PauseInCallee_Middle'. 302 302 PASS: Should not pause in 'CaseSensitiveRegex_PauseInCallee_Outer'. 303 304 305 -- Running test case: Debugger.setShouldBlackboxURL.Toggle 306 Evaluating 'createScripts("Toggle")'... 307 Setting breakpoint in 'Toggle_Inner.js'... 308 309 Blackboxing 'toggle_middle.js'... 310 Evaluating 'Toggle_Outer(10)'... 311 312 PAUSED: 'Breakpoint' at 'Toggle_Inner:3:1'. 313 { 314 "breakpointId": "Toggle_Inner.js:3:0" 315 } 316 Stepping over... 317 318 PAUSED: 'BlackboxedScript' at 'Toggle_Outer:3:1'. 319 { 320 "originalReason": "other", 321 "originalData": { 322 "breakpointId": "Toggle_Inner.js:3:0" 323 } 324 } 325 Stepping over... 326 327 Resuming... 328 PASS: Resumed. 329 PASS: Should not pause in 'Toggle_Middle'. 330 331 Removing blackbox for 'toggle_middle.js'... 332 Evaluating 'Toggle_Outer(10)'... 333 334 PAUSED: 'Breakpoint' at 'Toggle_Inner:3:1'. 335 { 336 "breakpointId": "Toggle_Inner.js:3:0" 337 } 338 Stepping over... 339 340 PAUSED: 'other' at 'Toggle_Middle:3:1'. 341 Stepping over... 342 343 PAUSED: 'other' at 'Toggle_Outer:3:1'. 344 Stepping over... 345 346 Resuming... 347 PASS: Resumed. 348 PASS: Should pause in 'Toggle_Middle'. 303 349 304 350 -
trunk/LayoutTests/inspector/debugger/setShouldBlackboxURL.html
r251039 r252730 461 461 462 462 suite.addTestCase({ 463 name: "Debugger.setShouldBlackboxURL.Toggle", 464 description: "Check that the URL does not remain blackboxed if it's blackboxed state is toggled on and then off.", 465 async test() { 466 let resumePromise = null; 467 468 let [innerSourceURL, middleSourceURL, outerSourceURL] = await Promise.all([ 469 listenForSourceParsed(/Toggle_Inner\.js$/), 470 listenForSourceParsed(/Toggle_Middle\.js$/), 471 listenForSourceParsed(/Toggle_Outer\.js$/), 472 evaluate(`createScripts("Toggle")`), 473 ]); 474 await setBreakpoint(innerSourceURL, 3); // last line of function, so it only pauses once 475 476 ProtocolTest.newline(); 477 478 resumePromise = new Promise((resolve, reject) => { 479 resumeCallback = function() { 480 ProtocolTest.expectThat(!pausedFunctionNames.includes("Toggle_Middle"), "Should not pause in 'Toggle_Middle'."); 481 resolve(); 482 }; 483 }); 484 485 await setBlackbox(middleSourceURL); 486 await evaluate(`Toggle_Outer(10)`); 487 488 ProtocolTest.newline(); 489 490 await resumePromise; 491 492 resumePromise = new Promise((resolve, reject) => { 493 resumeCallback = function() { 494 ProtocolTest.expectThat(pausedFunctionNames.includes("Toggle_Middle"), "Should pause in 'Toggle_Middle'."); 495 resolve(); 496 }; 497 }); 498 499 ProtocolTest.log(`Removing blackbox for '${middleSourceURL.toLowerCase()}'...`); 500 await InspectorProtocol.awaitCommand({ 501 method: "Debugger.setShouldBlackboxURL", 502 params: {url: middleSourceURL.toLowerCase(), shouldBlackbox: false}, 503 }); 504 505 await evaluate(`Toggle_Outer(10)`); 506 507 ProtocolTest.newline(); 508 509 await resumePromise; 510 }, 511 }); 512 513 suite.addTestCase({ 463 514 name: "Debugger.setShouldBlackboxURL.Invalid.emptyURL", 464 515 description: "Check that an error is thrown if the given url is empty.", -
trunk/Source/JavaScriptCore/ChangeLog
r252728 r252730 1 2019-11-21 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: removing the blackbox for a specific script doesn't actually remove the blackbox 4 https://bugs.webkit.org/show_bug.cgi?id=204428 5 6 Reviewed by Timothy Hatcher. 7 8 Previously, when updating the blackbox state of each existing script, we would only tell the 9 `Debugger` about when scripts should be blackboxed, not when they shouldn't. This means that 10 when a given script is un-blackboxed, the `Debugger` would never get told about it and would 11 therefore still defer pauses as if it was blackboxed. 12 13 The solution to this is simple; update the blackboxed state of every script, not just those 14 that should be blackboxed, and tell the `Debugger` about each. 15 16 * inspector/agents/InspectorDebuggerAgent.cpp: 17 (Inspector::InspectorDebuggerAgent::setShouldBlackboxURL): 18 1 19 2019-11-20 Yusuke Suzuki <ysuzuki@apple.com> 2 20 -
trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
r251872 r252730 912 912 m_blackboxedURLs.removeAll(config); 913 913 914 auto blackboxType = shouldBlackbox ? Optional<JSC::Debugger::BlackboxType>(JSC::Debugger::BlackboxType::Deferred) : WTF::nullopt;915 914 for (auto& [sourceID, script] : m_scripts) { 916 915 if (isWebKitInjectedScript(script.sourceURL)) 917 916 continue; 918 if (!shouldBlackboxURL(script.sourceURL) && !shouldBlackboxURL(script.url)) 919 continue; 917 918 Optional<JSC::Debugger::BlackboxType> blackboxType; 919 if (shouldBlackboxURL(script.sourceURL) || shouldBlackboxURL(script.url)) 920 blackboxType = JSC::Debugger::BlackboxType::Deferred; 920 921 m_scriptDebugServer.setBlackboxType(sourceID, blackboxType); 921 922 }
Note:
See TracChangeset
for help on using the changeset viewer.