haikuwebkit/LayoutTests/inspector/dom-debugger
Devin Rousso 04af619b94 Web Inspector: console command line API should be exposed to breakpoint conditions/actions
https://bugs.webkit.org/show_bug.cgi?id=218141
<rdar://problem/70636727>

Reviewed by Brian Burg.

Source/JavaScriptCore:

* debugger/Debugger.h:
(JSC::Debugger::Client::scopeExtensionObject): Added.
* debugger/Debugger.cpp:
(JSC::Debugger::setClient): Added.
(JSC::Debugger::evaluateBreakpointCondition):
(JSC::Debugger::evaluateBreakpointActions):
Introduce an optional `Debugger::Client` virtual class that can be used to adjust behavior
in various situations. Right now it is used when evaluating breakpoint conditions/actions
to get a scope extension object.

* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::internalEnable):
(Inspector::InspectorDebuggerAgent::internalDisable):
(Inspector::InspectorDebuggerAgent::scopeExtensionObject): Added.
Implement `Debugger::Client` and provide a newly created `CommandLineAPI` instance.

* inspector/InjectedScript.h:
* inspector/InjectedScript.cpp:
(Inspector::InjectedScript::createCommandLineAPIObject const): Added.
* inspector/InjectedScriptSource.js:
(let.InjectedScript.prototype.createCommandLineAPIObject): Added.
(let.InjectedScript.prototype._evaluateOn):
Expose a way for the C++ to create `CommandLineAPI` instances.

Source/WebInspectorUI:

* UserInterface/Controllers/CodeMirrorCompletionController.js:
(WI.CodeMirrorCompletionController):
(WI.CodeMirrorCompletionController.prototype.get mode): Added.
(WI.CodeMirrorCompletionController.prototype.get delegate): Deleted.
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded):
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.shouldExposeEvent): Added.
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.shouldExposeException): Added.
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedPropertyNames):
Introduce a `Mode` enum that can be fetched by completion providers to adjust functionality.

* UserInterface/Views/BreakpointPopover.js:
(WI.BreakpointPopover.appendContextMenuItems):
(WI.BreakpointPopover.prototype.show):
(WI.BreakpointPopover.prototype.breakpointActionViewCodeMirrorCompletionControllerMode): Added.
(WI.BreakpointPopover.prototype.get codeMirrorCompletionControllerMode): Added.
* UserInterface/Views/EventBreakpointPopover.js:
(WI.EventBreakpointPopover.prototype.get codeMirrorCompletionControllerMode): Added.
* UserInterface/Views/BreakpointActionView.js:
(WI.BreakpointActionView.prototype._updateBody):
Use a `Mode` that always exposes `$event`/`$exception` depending on the breakpoint type.

* UserInterface/Views/ConsolePrompt.js:
(WI.ConsolePrompt):
Use a `Mode` that only exposes `$event`/`$exception` when paused for an event/exeption.

* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WI.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked):
Use a `Mode` that always exposes `$event`/`$exception` since watch expressions track values
over time, and may therefore not always have an `$event`/`$exception` set.

* UserInterface/Views/TextEditor.js:
(WI.TextEditor):
Use the default `Mode` that never exposes `$event`/`$exception`.

LayoutTests:

* inspector/debugger/resources/breakpoint-options-utilities.js:
* inspector/debugger/break-on-exception-expected.txt:
* inspector/debugger/break-on-uncaught-exception-expected.txt:
* inspector/debugger/setPauseOnAssertions-expected.txt:
* inspector/debugger/setPauseOnDebuggerStatements-expected.txt:
* inspector/debugger/setPauseOnMicrotasks-expected.txt:
* inspector/dom-debugger/attribute-modified-style-expected.txt:
* inspector/dom-debugger/dom-breakpoint-attribute-modified-expected.txt:
* inspector/dom-debugger/dom-breakpoint-node-removed-ancestor-expected.txt:
* inspector/dom-debugger/dom-breakpoint-node-removed-direct-expected.txt:
* inspector/dom-debugger/dom-breakpoint-subtree-modified-add-expected.txt:
* inspector/dom-debugger/dom-breakpoint-subtree-modified-remove-expected.txt:
* inspector/dom-debugger/event-animation-frame-breakpoints-expected.txt:
* inspector/dom-debugger/event-interval-breakpoints-expected.txt:
* inspector/dom-debugger/event-listener-breakpoints-expected.txt:
* inspector/dom-debugger/event-timeout-breakpoints-expected.txt:
* inspector/dom-debugger/url-breakpoints-all-requests-expected.txt:
* inspector/dom-debugger/url-breakpoints-containing-expected.txt:
* inspector/dom-debugger/url-breakpoints-matching-expected.txt:


Canonical link: https://commits.webkit.org/230914@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269023 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-27 06:39:08 +00:00
..
resources Web Inspector: allow DOM breakpoints to be configured 2020-09-05 20:06:22 +00:00
attribute-modified-style-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
attribute-modified-style.html Web Inspector: allow DOM breakpoints to be configured 2020-09-05 20:06:22 +00:00
dom-breakpoint-attribute-modified-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
dom-breakpoint-attribute-modified.html Web Inspector: allow DOM breakpoints to be configured 2020-09-05 20:06:22 +00:00
dom-breakpoint-node-removed-ancestor-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
dom-breakpoint-node-removed-ancestor.html Web Inspector: allow DOM breakpoints to be configured 2020-09-05 20:06:22 +00:00
dom-breakpoint-node-removed-direct-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
dom-breakpoint-node-removed-direct.html Web Inspector: allow DOM breakpoints to be configured 2020-09-05 20:06:22 +00:00
dom-breakpoint-subtree-modified-add-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
dom-breakpoint-subtree-modified-add.html Web Inspector: allow DOM breakpoints to be configured 2020-09-05 20:06:22 +00:00
dom-breakpoint-subtree-modified-remove-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
dom-breakpoint-subtree-modified-remove.html Web Inspector: allow DOM breakpoints to be configured 2020-09-05 20:06:22 +00:00
dom-breakpoints-expected.txt Web Inspector: allow DOM breakpoints to be configured 2020-09-05 20:06:22 +00:00
dom-breakpoints.html Web Inspector: allow DOM breakpoints to be configured 2020-09-05 20:06:22 +00:00
event-animation-frame-breakpoints-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
event-animation-frame-breakpoints.html Web Inspector: allow url breakpoints to be configured 2020-09-03 20:07:39 +00:00
event-breakpoint-with-navigation-expected.txt Web Inspector: DOM: add a special breakpoint for "All Events" 2019-08-03 19:00:01 +00:00
event-breakpoint-with-navigation.html
event-interval-breakpoints-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
event-interval-breakpoints.html Web Inspector: allow url breakpoints to be configured 2020-09-03 20:07:39 +00:00
event-listener-breakpoints-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
event-listener-breakpoints.html Web Inspector: allow url breakpoints to be configured 2020-09-03 20:07:39 +00:00
event-timeout-breakpoints-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
event-timeout-breakpoints.html Web Inspector: allow url breakpoints to be configured 2020-09-03 20:07:39 +00:00
node-removed-expected.txt
node-removed.html
url-breakpoints-all-requests-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
url-breakpoints-all-requests.html Web Inspector: allow url breakpoints to be configured 2020-09-03 20:07:39 +00:00
url-breakpoints-containing-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
url-breakpoints-containing.html Web Inspector: allow url breakpoints to be configured 2020-09-03 20:07:39 +00:00
url-breakpoints-expected.txt Web Inspector: allow url breakpoints to be configured 2020-09-03 20:07:39 +00:00
url-breakpoints-matching-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
url-breakpoints-matching.html Web Inspector: allow url breakpoints to be configured 2020-09-03 20:07:39 +00:00
url-breakpoints.html Web Inspector: allow url breakpoints to be configured 2020-09-03 20:07:39 +00:00