haikuwebkit/LayoutTests/inspector/debugger
Devin Rousso 7290e95370 Web Inspector: Debugger: allow breakpoint actions to be evaluated as a user gesture
https://bugs.webkit.org/show_bug.cgi?id=200275

Reviewed by Brian Burg.

Source/JavaScriptCore:

* inspector/protocol/Debugger.json:
* debugger/Breakpoint.h:
Add an optional `emulateUserGesture` property to `Debugger.BreakpointAction`.

* debugger/Debugger.h:
(JSC::Debugger::Client::debuggerScopeExtensionObject): Renamed from `scopeExtensionObject`.
(JSC::Debugger::Client::debuggerWillEvaluate): Added.
(JSC::Debugger::Client::debuggerDidEvaluate): Added.
* debugger/Debugger.cpp:
(JSC::Debugger::evaluateBreakpointCondition):
(JSC::Debugger::evaluateBreakpointActions):
Consult the `Debugger::Client` before and after evaluating each `Breakpoint::Action`.
Currently this is used by `WebCore::PageDebuggerAgent` to push onto or pop from a stack of
`WebCore::UserGestureEmulationScope`, each corresponding to a `Breakpoint::Action` that
has been set with `emulateUserGesture`.

* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::parseBreakpointOptions):
(Inspector::InspectorDebuggerAgent::debuggerScopeExtensionObject): Renamed from `scopeExtensionObject`.

Source/WebCore:

Tests: inspector/debugger/breakpoint-action-emulateUserGesture.html
       inspector/debugger/breakpoint-action-emulateUserGesture-userIsInteracting.html

* inspector/agents/page/PageDebuggerAgent.cpp:
* inspector/agents/page/PageDebuggerAgent.h:
(WebCore::PageDebuggerAgent::debuggerWillEvaluate): Added.
(WebCore::PageDebuggerAgent::debuggerDidEvaluate): Added.
Maintain a stack of `UserGestureEmulationScope` whenever evaluating breakpoint actions (but
only add/remove items if the current action is set to `emulateUserGesture`).

* inspector/agents/page/UserGestureEmulationScope.h:
Make it fast allocated so it can be used with `UniqueRef`.

Source/WebInspectorUI:

* UserInterface/Models/BreakpointAction.js:
(WI.BreakpointAction.supportsEmulateUserAction): Added.
(WI.BreakpointAction.fromJSON):
(WI.BreakpointAction.prototype.toJSON):
(WI.BreakpointAction.prototype.set type):
(WI.BreakpointAction.prototype.set data):
(WI.BreakpointAction.prototype.get emulateUserGesture): Added.
(WI.BreakpointAction.prototype.set emulateUserGesture): Added.
Add an `_emulateUserGesture` property to match `Debugger.BreakpointAction`.

* UserInterface/Views/BreakpointActionView.js:
(WI.BreakpointActionView):
(WI.BreakpointActionView.prototype._updateBody):
(WI.BreakpointActionView.prototype._handleEmulateUserGestureCheckboxChange): Added.
* UserInterface/Views/BreakpointActionView.css:
(.breakpoint-action-block-body .description): Added.
(.breakpoint-action-block-body > .flex):
(.breakpoint-action-block-body > .description): Deleted.
Add a "[ ] Emulate User Gesture" under the log/evaluate/probe input.

* UserInterface/Models/Breakpoint.js:
(WI.Breakpoint):
(WI.Breakpoint.prototype.addAction):
(WI.Breakpoint.prototype.removeAction):
(WI.Breakpoint.prototype._handleBreakpointActionModified): Renamed from `_handleBreakpointActionChanged`.
Drive-by: combine `TypeChanged` and `DataChanged` into a single `Modified` event since all
the listeners currently have the same callback.

* UserInterface/Views/LogContentView.js:
(WI.LogContentView):
(WI.LogContentView.prototype._handleEmulateInUserGestureSettingChanged):
Drive-by: only show the "Emulate User Gesture" checkbox when it's supported.

* Localizations/en.lproj/localizedStrings.js:

LayoutTests:

* inspector/debugger/breakpoint-action-emulateUserGesture.html: Added.
* inspector/debugger/breakpoint-action-emulateUserGesture-expected.txt: Added.
* inspector/debugger/breakpoint-action-emulateUserGesture-userIsInteracting.html: Added.
* inspector/debugger/breakpoint-action-emulateUserGesture-userIsInteracting-expected.txt: Added.

* TestExpectations:
* platform/wk2/TestExpectations:


Canonical link: https://commits.webkit.org/232935@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271373 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-11 20:13:30 +00:00
..
breakpoints Remove trailing spaces from expected.txt files (excluding WPT for now since that contains too many) 2020-09-27 02:15:19 +00:00
resources Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
stepping Remove trailing spaces from expected.txt files (excluding WPT for now since that contains too many) 2020-09-27 02:15:19 +00:00
tail-deleted-frames Web Inspector: show EventTarget listeners as an internal property 2020-05-14 02:36:41 +00:00
async-stack-trace-basic-expected.txt
async-stack-trace-basic.html
async-stack-trace-event-listener-expected.txt
async-stack-trace-event-listener.html Web Inspector: split-up async stack trace test suite to improve clarity and maintainability 2018-08-06 23:53:33 +00:00
async-stack-trace-truncate-expected.txt
async-stack-trace-truncate.html
break-in-constructor-before-super-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
break-in-constructor-before-super.html [ macOS ] inspector/debugger/break-in-constructor-before-super.html is a flaky failure 2020-06-06 12:51:50 +00:00
break-on-exception-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
break-on-exception-throw-in-promise-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
break-on-exception-throw-in-promise.html Web Inspector: simplify WebInspector with WI 2017-08-02 03:09:57 +00:00
break-on-exception.html Web Inspector: allow special JavaScript breakpoints to be configured 2020-09-03 17:53:21 +00:00
break-on-uncaught-exception-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
break-on-uncaught-exception-throw-in-promise-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
break-on-uncaught-exception-throw-in-promise.html Web Inspector: Hide DOM and XHR breakpoint sections when they are empty 2018-09-27 06:24:39 +00:00
break-on-uncaught-exception.html Web Inspector: allow special JavaScript breakpoints to be configured 2020-09-03 17:53:21 +00:00
breakpoint-action-detach-expected.txt Web Inspector: move LayoutTests/inspector-protocol/ tests to LayoutTests/inspector/ 2015-08-07 18:33:16 +00:00
breakpoint-action-detach.html
breakpoint-action-emulateUserGesture-expected.txt Web Inspector: Debugger: allow breakpoint actions to be evaluated as a user gesture 2021-01-11 20:13:30 +00:00
breakpoint-action-emulateUserGesture-userIsInteracting-expected.txt Web Inspector: Debugger: allow breakpoint actions to be evaluated as a user gesture 2021-01-11 20:13:30 +00:00
breakpoint-action-emulateUserGesture-userIsInteracting.html Web Inspector: Debugger: allow breakpoint actions to be evaluated as a user gesture 2021-01-11 20:13:30 +00:00
breakpoint-action-emulateUserGesture.html Web Inspector: Debugger: allow breakpoint actions to be evaluated as a user gesture 2021-01-11 20:13:30 +00:00
breakpoint-action-eval-expected.txt
breakpoint-action-eval.html Web Inspector: allow event breakpoints to be configured when they're added 2020-09-02 19:20:23 +00:00
breakpoint-action-log-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
breakpoint-action-log.html Web Inspector: allow event breakpoints to be configured when they're added 2020-09-02 19:20:23 +00:00
breakpoint-action-with-exception-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
breakpoint-action-with-exception.html Web Inspector: Cleanup inspector/debugger tests 2016-04-15 17:18:12 +00:00
breakpoint-columns-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
breakpoint-columns.html Web Inspector: allow event breakpoints to be configured 2020-08-24 17:34:12 +00:00
breakpoint-condition-detach-expected.txt Web Inspector: move LayoutTests/inspector-protocol/ tests to LayoutTests/inspector/ 2015-08-07 18:33:16 +00:00
breakpoint-condition-detach.html
breakpoint-condition-with-bad-script-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
breakpoint-condition-with-bad-script.html
breakpoint-condition-with-exception-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
breakpoint-condition-with-exception.html Web Inspector: Cleanup inspector/debugger tests 2016-04-15 17:18:12 +00:00
breakpoint-eval-with-exception-expected.txt
breakpoint-eval-with-exception.html
breakpoint-inside-conditons-and-actions-expected.txt
breakpoint-inside-conditons-and-actions.html
breakpoint-resolve-when-script-added-expected.txt Web Inspector: REGRESSION(r266074): line-based JavaScript breakpoints don't hit after reload 2020-10-17 04:07:22 +00:00
breakpoint-resolve-when-script-added.html Web Inspector: REGRESSION(r266074): line-based JavaScript breakpoints don't hit after reload 2020-10-17 04:07:22 +00:00
breakpoint-scope-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
breakpoint-scope.html Web Inspector: allow event breakpoints to be configured 2020-08-24 17:34:12 +00:00
breakpoint-syntax-error-top-level-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
breakpoint-syntax-error-top-level.html Web Inspector: DebuggerManager.Event.Resumed introduces test flakiness 2016-11-10 06:07:07 +00:00
breakpoints-disabled-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
breakpoints-disabled.html
call-frame-function-name-expected.txt Web Inspector: move LayoutTests/inspector-protocol/ tests to LayoutTests/inspector/ 2015-08-07 18:33:16 +00:00
call-frame-function-name.html Web Inspector: move InspectorFrontendAPIDispatcher to WebCore, clean up uses 2020-10-30 23:56:26 +00:00
call-frame-this-host-expected.txt
call-frame-this-host.html Web Inspector: move InspectorFrontendAPIDispatcher to WebCore, clean up uses 2020-10-30 23:56:26 +00:00
call-frame-this-nonstrict-expected.txt Web Inspector: move LayoutTests/inspector-protocol/ tests to LayoutTests/inspector/ 2015-08-07 18:33:16 +00:00
call-frame-this-nonstrict.html
call-frame-this-strict-expected.txt
call-frame-this-strict.html
command-line-api-exception-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
command-line-api-exception-nested-catch-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
command-line-api-exception-nested-catch.html
command-line-api-exception.html
continueUntilNextRunLoop-expected.txt Web Inspector: unify agent command error messages 2019-08-27 01:02:20 +00:00
continueUntilNextRunLoop.html
csp-exceptions-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
csp-exceptions.html
debugger-stack-overflow-expected.txt
debugger-stack-overflow.html Web Inspector: allow event breakpoints to be configured 2020-08-24 17:34:12 +00:00
debugger-statement-expected.txt
debugger-statement.html [ macOS ] inspector/debugger/break-in-constructor-before-super.html is a flaky failure 2020-06-06 12:51:50 +00:00
didSampleProbe-multiple-probes-expected.txt
didSampleProbe-multiple-probes.html
evaluateOnCallFrame-CommandLineAPI-expected.txt
evaluateOnCallFrame-CommandLineAPI.html
evaluateOnCallFrame-emulateUserGesture-expected.txt
evaluateOnCallFrame-emulateUserGesture-userIsInteracting-expected.txt
evaluateOnCallFrame-emulateUserGesture-userIsInteracting.html
evaluateOnCallFrame-emulateUserGesture.html
evaluateOnCallFrame-errors-expected.txt Web Inspector: unify agent command error messages 2019-08-27 01:02:20 +00:00
evaluateOnCallFrame-errors.html
evaluateOnCallFrame-exception-expected.txt
evaluateOnCallFrame-exception.html Tail Deleted Frames shown in Web Inspector are sometimes incorrect (Shadow Chicken) 2019-09-06 19:11:20 +00:00
hit-breakpoint-from-console-expected.txt Web Inspector: move LayoutTests/inspector-protocol/ tests to LayoutTests/inspector/ 2015-08-07 18:33:16 +00:00
hit-breakpoint-from-console.html Web Inspector: move InspectorFrontendAPIDispatcher to WebCore, clean up uses 2020-10-30 23:56:26 +00:00
js-stacktrace-expected.txt
js-stacktrace.html
nested-inspectors-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
nested-inspectors.html
no-pause-out-of-memory-exception-expected.txt [JSC] Make OutOfMemory error as instance of RangeError 2020-05-16 08:24:22 +00:00
no-pause-out-of-memory-exception.html Web Inspector: simplify WebInspector with WI 2017-08-02 03:09:57 +00:00
no-pause-stack-overflow-exception-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
no-pause-stack-overflow-exception.html Web Inspector: simplify WebInspector with WI 2017-08-02 03:09:57 +00:00
pause-for-internal-scripts-expected.txt Remove trailing spaces from expected.txt files (excluding WPT for now since that contains too many) 2020-09-27 02:15:19 +00:00
pause-for-internal-scripts.html
pause-on-assert-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
pause-on-assert.html
pause-reason-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
pause-reason.html Web Inspector: allow event breakpoints to be configured 2020-08-24 17:34:12 +00:00
paused-scopes-expected.txt Remove trailing spaces from expected.txt files (excluding WPT for now since that contains too many) 2020-09-27 02:15:19 +00:00
paused-scopes.html
probe-manager-add-remove-actions-expected.txt Web Inspector: frontend tests should clear output before resending results 2019-10-23 19:09:04 +00:00
probe-manager-add-remove-actions.html Web Inspector: allow event breakpoints to be configured when they're added 2020-09-02 19:20:23 +00:00
regress-133182-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
regress-133182.html
reload-paused-expected.txt
reload-paused.html
removeBreakpoint-expected.txt
removeBreakpoint.html
scriptParsed-expected.txt
scriptParsed.html
search-scripts-expected.txt
search-scripts.html
searchInContent-linebreaks-expected.txt
searchInContent-linebreaks.html
setBreakpoint-actions-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
setBreakpoint-actions.html
setBreakpoint-autoContinue-expected.txt
setBreakpoint-autoContinue.html Web Inspector: move InspectorFrontendAPIDispatcher to WebCore, clean up uses 2020-10-30 23:56:26 +00:00
setBreakpoint-column-expected.txt
setBreakpoint-column.html Web Inspector: move InspectorFrontendAPIDispatcher to WebCore, clean up uses 2020-10-30 23:56:26 +00:00
setBreakpoint-column.txt
setBreakpoint-condition-expected.txt Web Inspector: move InspectorFrontendAPIDispatcher to WebCore, clean up uses 2020-10-30 23:56:26 +00:00
setBreakpoint-condition-ignoreCount-expected.txt Web Inspector: breakpoint condition should be evaluated before the ignore count 2020-08-25 18:49:57 +00:00
setBreakpoint-condition-ignoreCount.html Web Inspector: breakpoint condition should be evaluated before the ignore count 2020-08-25 18:49:57 +00:00
setBreakpoint-condition.html Web Inspector: move InspectorFrontendAPIDispatcher to WebCore, clean up uses 2020-10-30 23:56:26 +00:00
setBreakpoint-dfg-and-modify-local-expected.txt
setBreakpoint-dfg-and-modify-local.html
setBreakpoint-dfg-callee-and-examine-dfg-local-expected.txt [GTK] Layout test inspector-protocol/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html is flaky 2019-10-26 06:12:14 +00:00
setBreakpoint-dfg-callee-and-examine-dfg-local.html [GTK] Layout test inspector-protocol/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html is flaky 2019-10-26 06:12:14 +00:00
setBreakpoint-dfg-expected.txt inspector-protocol/debugger/setBreakpoint-dfg.html is flaky 2019-10-31 04:54:46 +00:00
setBreakpoint-dfg.html inspector-protocol/debugger/setBreakpoint-dfg.html is flaky 2019-10-31 04:54:46 +00:00
setBreakpoint-expected.txt Web Inspector: unify agent command error messages 2019-08-27 01:02:20 +00:00
setBreakpoint-options-exception-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
setBreakpoint-options-exception.html
setBreakpoint.html Web Inspector: move InspectorFrontendAPIDispatcher to WebCore, clean up uses 2020-10-30 23:56:26 +00:00
setBreakpointByUrl-sourceURL-expected.txt
setBreakpointByUrl-sourceURL.html Web Inspector: move InspectorFrontendAPIDispatcher to WebCore, clean up uses 2020-10-30 23:56:26 +00:00
setPauseOnAssertions-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
setPauseOnAssertions.html Web Inspector: allow special JavaScript breakpoints to be configured 2020-09-03 17:53:21 +00:00
setPauseOnDebuggerStatements-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
setPauseOnDebuggerStatements.html Web Inspector: allow special JavaScript breakpoints to be configured 2020-09-03 17:53:21 +00:00
setPauseOnExceptions-all-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
setPauseOnExceptions-all.html Non-standard Error properties should not be enumerable 2019-09-27 18:32:47 +00:00
setPauseOnExceptions-none-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
setPauseOnExceptions-none.html Non-standard Error properties should not be enumerable 2019-09-27 18:32:47 +00:00
setPauseOnExceptions-uncaught-expected.txt Changes to shared testing JS files should not cause test failures due to console message line numbers changing 2020-04-10 21:10:11 +00:00
setPauseOnExceptions-uncaught.html Non-standard Error properties should not be enumerable 2019-09-27 18:32:47 +00:00
setPauseOnMicrotasks-expected.txt Web Inspector: console command line API should be exposed to breakpoint conditions/actions 2020-10-27 06:39:08 +00:00
setPauseOnMicrotasks.html Web Inspector: use weak collections for holding event listeners 2020-11-04 11:30:05 +00:00
setShouldBlackboxURL-expected.txt Web Inspector: removing the blackbox for a specific script doesn't actually remove the blackbox 2019-11-21 12:14:59 +00:00
setShouldBlackboxURL.html Web Inspector: removing the blackbox for a specific script doesn't actually remove the blackbox 2019-11-21 12:14:59 +00:00
sourceURL-repeated-identical-executions-expected.txt
sourceURL-repeated-identical-executions.html
sourceURLs-expected.txt
sourceURLs.html
tail-deleted-frames-this-value-expected.txt REGRESSION (r249078): Flaky crash in com.apple.JavaScriptCore: Inspector::InjectedScriptModule::ensureInjected 2019-09-03 23:37:12 +00:00
tail-deleted-frames-this-value.html Web Inspector: allow event breakpoints to be configured 2020-08-24 17:34:12 +00:00
tail-recursion-expected.txt
tail-recursion.html Web Inspector: allow event breakpoints to be configured 2020-08-24 17:34:12 +00:00
truncate-async-stack-trace-expected.txt
truncate-async-stack-trace.html