haikuwebkit/LayoutTests/inspector/dom-debugger/dom-breakpoint-attribute-mo...

187 lines
4.8 KiB
Plaintext
Raw Permalink Normal View History

Web Inspector: allow DOM breakpoints to be configured https://bugs.webkit.org/show_bug.cgi?id=215795 Reviewed by Brian Burg. Source/JavaScriptCore: * inspector/protocol/DOMDebugger.json: Add an `options` parameter to `DOMDebugger.setDOMBreakpoint` to allow configuration. Source/WebCore: Tests: inspector/dom-debugger/attribute-modified-style.html inspector/dom-debugger/dom-breakpoints.html inspector/dom-debugger/dom-breakpoint-attribute-modified.html inspector/dom-debugger/dom-breakpoint-node-removed-ancestor.html inspector/dom-debugger/dom-breakpoint-node-removed-direct.html inspector/dom-debugger/dom-breakpoint-subtree-modified-add.html inspector/dom-debugger/dom-breakpoint-subtree-modified-remove.html * inspector/agents/page/PageDOMDebuggerAgent.h: * inspector/agents/page/PageDOMDebuggerAgent.cpp: (WebCore::PageDOMDebuggerAgent::disable): (WebCore::PageDOMDebuggerAgent::setDOMBreakpoint): (WebCore::PageDOMDebuggerAgent::removeDOMBreakpoint): (WebCore::PageDOMDebuggerAgent::frameDocumentUpdated): (WebCore::calculateDistance): Added. (WebCore::PageDOMDebuggerAgent::willInsertDOMNode): (WebCore::PageDOMDebuggerAgent::willRemoveDOMNode): (WebCore::PageDOMDebuggerAgent::didRemoveDOMNode): (WebCore::PageDOMDebuggerAgent::willModifyDOMAttr): (WebCore::PageDOMDebuggerAgent::willInvalidateStyleAttr): (WebCore::PageDOMDebuggerAgent::buildPauseDataForDOMBreakpoint): Added. (WebCore::domTypeForName): Deleted. (WebCore::domTypeName): Deleted. (WebCore::PageDOMDebuggerAgent::didInsertDOMNode): Deleted. (WebCore::PageDOMDebuggerAgent::descriptionForDOMEvent): Deleted. (WebCore::PageDOMDebuggerAgent::updateSubtreeBreakpoints): Deleted. (WebCore::PageDOMDebuggerAgent::hasBreakpoint): Deleted. Replace the bitmask with separate `HashMap` for each type of DOM breakpoint. Instead of propagating the `SubtreeModified` bit to the entire subtree when new nodes are added (which means there's an entry in the `HashMap` for every descendant) and removing them all when that node is removed, only keep nodes in each `HashMap` if it directly has a DOM breakpoint. Walk up the ancestor chain when nodes are added/removed to determine if there is a nearby breakpoint to pause. When a node is removed, remove any existing DOM breakpoint if it's owner is part of the removed subtree. * inspector/agents/worker/WorkerDOMDebuggerAgent.h: * inspector/agents/worker/WorkerDOMDebuggerAgent.cpp: (WebCore::WorkerDOMDebuggerAgent::setDOMBreakpoint): * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didInsertDOMNodeImpl): Source/WebInspectorUI: * UserInterface/Controllers/DOMManager.js: (WI.DOMManager.prototype._setChildNodes): Dispatch events for each new child node added and each existing child node removed so that any listeners can also know when new nodes are added via a full children payload update. * UserInterface/Controllers/DOMDebuggerManager.js: (WI.DOMDebuggerManager): (WI.DOMDebuggerManager.prototype.addDOMBreakpoint): (WI.DOMDebuggerManager.prototype.removeDOMBreakpoint): (WI.DOMDebuggerManager.prototype._detachDOMBreakpointsForFrame): Added. (WI.DOMDebuggerManager.prototype._speculativelyResolveDOMBreakpointsForURL): (WI.DOMDebuggerManager.prototype._speculativelyResolveDOMBreakpoint): Added. (WI.DOMDebuggerManager.prototype._resolveDOMBreakpoint): (WI.DOMDebuggerManager.prototype._setDOMBreakpoint): Added. (WI.DOMDebuggerManager.prototype._removeDOMBreakpoint): Added. (WI.DOMDebuggerManager.prototype._handleDOMBreakpointDisabledStateChanged): (WI.DOMDebuggerManager.prototype._handleDOMBreakpointEditablePropertyChanged): Added. (WI.DOMDebuggerManager.prototype._handleDOMBreakpointActionsChanged): Added. (WI.DOMDebuggerManager.prototype._handleDOMBreakpointDOMNodeWillChange): Added. (WI.DOMDebuggerManager.prototype._handleDOMBreakpointDOMNodeDidChange): Added. (WI.DOMDebuggerManager.prototype._childFrameWasRemoved): (WI.DOMDebuggerManager.prototype._mainResourceDidChange): (WI.DOMDebuggerManager.prototype._nodeInserted): (WI.DOMDebuggerManager.prototype._nodeRemoved): (WI.DOMDebuggerManager.prototype._detachDOMBreakpoint): Deleted. (WI.DOMDebuggerManager.prototype._detachBreakpointsForFrame): Deleted. (WI.DOMDebuggerManager.prototype._updateDOMBreakpoint): Deleted. Recursively walk any added node's subtree to resolve and set any matching DOM breakpoints. Iterate all existing DOM breakpoints to see if the owner node is part of the subtree of any removed nodes and remove ot if so. * UserInterface/Models/DOMBreakpoint.js: (WI.DOMBreakpoint): (WI.DOMBreakpoint.displayNameForType): (WI.DOMBreakpoint.fromJSON): (WI.DOMBreakpoint.prototype.get editable): Added. (WI.DOMBreakpoint.prototype.get domNode): Added. (WI.DOMBreakpoint.prototype.set domNode): Added. (WI.DOMBreakpoint.prototype.get domNodeIdentifier): Deleted. (WI.DOMBreakpoint.prototype.set domNodeIdentifier): Deleted. * UserInterface/Views/DOMTreeContentView.js: (WI.DOMTreeContentView): (WI.DOMTreeContentView.prototype.closed): (WI.DOMTreeContentView.prototype._domTreeElementAdded): (WI.DOMTreeContentView.prototype._domBreakpointAddedOrRemoved): (WI.DOMTreeContentView.prototype._handleDOMBreakpointDisabledStateChanged): (WI.DOMTreeContentView.prototype._handleDOMBreakpointDOMNodeWillChange): Added. (WI.DOMTreeContentView.prototype._handleDOMBreakpointDOMNodeDidChange): Added. (WI.DOMTreeContentView.prototype._updateBreakpointStatus): (WI.DOMTreeContentView.prototype._restoreBreakpointsAfterUpdate): (WI.DOMTreeContentView.prototype._handleDOMBreakpointDOMNodeChanged): Deleted. * UserInterface/Views/SourcesNavigationSidebarPanel.js: (WI.SourcesNavigationSidebarPanel): (WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection): (WI.SourcesNavigationSidebarPanel.prototype._handleDOMBreakpointDOMNodeWillChange): Added. (WI.SourcesNavigationSidebarPanel.prototype._handleDOMBreakpointDOMNodeDidChange): Added. (WI.SourcesNavigationSidebarPanel.prototype._handleDOMBreakpointDOMNodeChanged): Deleted. Use a `WI.DOMNode` instead of an identifier instead of fetching the node for the identifier each time and checking if is valid. LayoutTests: * inspector/debugger/resources/breakpoint-options-utilities.js: (TestPage.registerInitializer.InspectorTest.BreakpointOptions.addTestCases): * inspector/dom-debugger/resources/dom-breakpoint-utilities.js: Added. (TestPage.registerInitializer.InspectorTest.DOMBreakpoint.teardown): (TestPage.registerInitializer.InspectorTest.DOMBreakpoint.createBreakpoint): (TestPage.registerInitializer.InspectorTest.DOMBreakpoint.addBreakpoint): (TestPage.registerInitializer.InspectorTest.DOMBreakpoint.awaitQuerySelector): * inspector/dom-debugger/attribute-modified-style.html: * inspector/dom-debugger/attribute-modified-style-expected.txt: * inspector/dom-debugger/dom-breakpoints.html: * inspector/dom-debugger/dom-breakpoints-expected.txt: * inspector/dom-debugger/dom-breakpoint-attribute-modified.html: Added. * inspector/dom-debugger/dom-breakpoint-attribute-modified-expected.txt: Added. * inspector/dom-debugger/dom-breakpoint-node-removed-ancestor.html: Added. * inspector/dom-debugger/dom-breakpoint-node-removed-ancestor-expected.txt: Added. * inspector/dom-debugger/dom-breakpoint-node-removed-direct.html: Added. * inspector/dom-debugger/dom-breakpoint-node-removed-direct-expected.txt: Added. * inspector/dom-debugger/dom-breakpoint-subtree-modified-add.html: Added. * inspector/dom-debugger/dom-breakpoint-subtree-modified-remove-expected.txt: Added. * inspector/dom-debugger/dom-breakpoint-subtree-modified-remove.html: Added. * inspector/dom-debugger/dom-breakpoint-subtree-modified-add-expected.txt: Added. Canonical link: https://commits.webkit.org/229038@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266669 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-05 20:06:22 +00:00
CONSOLE MESSAGE: BREAKPOINT ACTION LOG 1
CONSOLE MESSAGE: BREAKPOINT ACTION LOG 2
CONSOLE MESSAGE: BREAKPOINT ACTION LOG 3
CONSOLE MESSAGE: BREAKPOINT ACTION LOG 4
Tests for DOM breakpoints.
== Running test suite: DOMBreakpoint.AttributeModified
-- Running test case: DOMBreakpoint.AttributeModified.BreakpointEnabled
Adding "attribute-modified:1,HTML,1,BODY,1,DIV,0,DIV" DOM Breakpoint...
PAUSED:
PASS: Pause reason should be DOM.
PASS: Pause type should be 'attribute-modified'.
PASS: Pause nodeId should be expected value.
CALL STACK:
0: [F] testAttributeModified
1: [P] Global Code
-- Running test teardown.
-- Running test case: DOMBreakpoint.AttributeModified.BreakpointDisabled
Adding "attribute-modified:1,HTML,1,BODY,1,DIV,0,DIV" DOM Breakpoint...
Disabling breakpoint...
Triggering breakpoint...
PASS: Should not pause for disabled breakpoint.
-- Running test teardown.
-- Running test case: DOMBreakpoint.AttributeModified.DebuggerDisabled
Adding "attribute-modified:1,HTML,1,BODY,1,DIV,0,DIV" DOM Breakpoint...
Disabling all breakpoints...
Triggering breakpoint...
Enabling all breakpoints...
PASS: Should not pause when all breakpoints disabled.
-- Running test teardown.
-- Running test case: DOMBreakpoint.AttributeModified.RemoveBreakpoint
Adding "attribute-modified:1,HTML,1,BODY,1,DIV,0,DIV" DOM Breakpoint...
Removing breakpoint...
Triggering breakpoint...
PASS: Should not pause for removed breakpoint.
-- Running test teardown.
-- Running test case: DOMBreakpoint.AttributeModified.Options.Condition
Adding "attribute-modified:1,HTML,1,BODY,1,DIV,0,DIV" DOM Breakpoint...
Setting condition to 'false'...
Triggering breakpoint...
PASS: Should not pause.
Triggering breakpoint...
PASS: Should not pause.
Setting condition to 'true'...
Triggering breakpoint...
PASS: Should pause.
Triggering breakpoint...
PASS: Should pause.
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
-- Running test case: DOMBreakpoint.AttributeModified.Options.Condition.ConsoleCommandLineAPI
Adding saved console value 'false'...
Adding "attribute-modified:1,HTML,1,BODY,1,DIV,0,DIV" DOM Breakpoint...
Setting condition to saved console value...
Triggering breakpoint...
PASS: Should not pause.
Triggering breakpoint...
PASS: Should not pause.
Adding saved console value 'true'...
Setting condition to saved console value...
Triggering breakpoint...
PASS: Should pause.
Triggering breakpoint...
PASS: Should pause.
Web Inspector: allow DOM breakpoints to be configured https://bugs.webkit.org/show_bug.cgi?id=215795 Reviewed by Brian Burg. Source/JavaScriptCore: * inspector/protocol/DOMDebugger.json: Add an `options` parameter to `DOMDebugger.setDOMBreakpoint` to allow configuration. Source/WebCore: Tests: inspector/dom-debugger/attribute-modified-style.html inspector/dom-debugger/dom-breakpoints.html inspector/dom-debugger/dom-breakpoint-attribute-modified.html inspector/dom-debugger/dom-breakpoint-node-removed-ancestor.html inspector/dom-debugger/dom-breakpoint-node-removed-direct.html inspector/dom-debugger/dom-breakpoint-subtree-modified-add.html inspector/dom-debugger/dom-breakpoint-subtree-modified-remove.html * inspector/agents/page/PageDOMDebuggerAgent.h: * inspector/agents/page/PageDOMDebuggerAgent.cpp: (WebCore::PageDOMDebuggerAgent::disable): (WebCore::PageDOMDebuggerAgent::setDOMBreakpoint): (WebCore::PageDOMDebuggerAgent::removeDOMBreakpoint): (WebCore::PageDOMDebuggerAgent::frameDocumentUpdated): (WebCore::calculateDistance): Added. (WebCore::PageDOMDebuggerAgent::willInsertDOMNode): (WebCore::PageDOMDebuggerAgent::willRemoveDOMNode): (WebCore::PageDOMDebuggerAgent::didRemoveDOMNode): (WebCore::PageDOMDebuggerAgent::willModifyDOMAttr): (WebCore::PageDOMDebuggerAgent::willInvalidateStyleAttr): (WebCore::PageDOMDebuggerAgent::buildPauseDataForDOMBreakpoint): Added. (WebCore::domTypeForName): Deleted. (WebCore::domTypeName): Deleted. (WebCore::PageDOMDebuggerAgent::didInsertDOMNode): Deleted. (WebCore::PageDOMDebuggerAgent::descriptionForDOMEvent): Deleted. (WebCore::PageDOMDebuggerAgent::updateSubtreeBreakpoints): Deleted. (WebCore::PageDOMDebuggerAgent::hasBreakpoint): Deleted. Replace the bitmask with separate `HashMap` for each type of DOM breakpoint. Instead of propagating the `SubtreeModified` bit to the entire subtree when new nodes are added (which means there's an entry in the `HashMap` for every descendant) and removing them all when that node is removed, only keep nodes in each `HashMap` if it directly has a DOM breakpoint. Walk up the ancestor chain when nodes are added/removed to determine if there is a nearby breakpoint to pause. When a node is removed, remove any existing DOM breakpoint if it's owner is part of the removed subtree. * inspector/agents/worker/WorkerDOMDebuggerAgent.h: * inspector/agents/worker/WorkerDOMDebuggerAgent.cpp: (WebCore::WorkerDOMDebuggerAgent::setDOMBreakpoint): * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didInsertDOMNodeImpl): Source/WebInspectorUI: * UserInterface/Controllers/DOMManager.js: (WI.DOMManager.prototype._setChildNodes): Dispatch events for each new child node added and each existing child node removed so that any listeners can also know when new nodes are added via a full children payload update. * UserInterface/Controllers/DOMDebuggerManager.js: (WI.DOMDebuggerManager): (WI.DOMDebuggerManager.prototype.addDOMBreakpoint): (WI.DOMDebuggerManager.prototype.removeDOMBreakpoint): (WI.DOMDebuggerManager.prototype._detachDOMBreakpointsForFrame): Added. (WI.DOMDebuggerManager.prototype._speculativelyResolveDOMBreakpointsForURL): (WI.DOMDebuggerManager.prototype._speculativelyResolveDOMBreakpoint): Added. (WI.DOMDebuggerManager.prototype._resolveDOMBreakpoint): (WI.DOMDebuggerManager.prototype._setDOMBreakpoint): Added. (WI.DOMDebuggerManager.prototype._removeDOMBreakpoint): Added. (WI.DOMDebuggerManager.prototype._handleDOMBreakpointDisabledStateChanged): (WI.DOMDebuggerManager.prototype._handleDOMBreakpointEditablePropertyChanged): Added. (WI.DOMDebuggerManager.prototype._handleDOMBreakpointActionsChanged): Added. (WI.DOMDebuggerManager.prototype._handleDOMBreakpointDOMNodeWillChange): Added. (WI.DOMDebuggerManager.prototype._handleDOMBreakpointDOMNodeDidChange): Added. (WI.DOMDebuggerManager.prototype._childFrameWasRemoved): (WI.DOMDebuggerManager.prototype._mainResourceDidChange): (WI.DOMDebuggerManager.prototype._nodeInserted): (WI.DOMDebuggerManager.prototype._nodeRemoved): (WI.DOMDebuggerManager.prototype._detachDOMBreakpoint): Deleted. (WI.DOMDebuggerManager.prototype._detachBreakpointsForFrame): Deleted. (WI.DOMDebuggerManager.prototype._updateDOMBreakpoint): Deleted. Recursively walk any added node's subtree to resolve and set any matching DOM breakpoints. Iterate all existing DOM breakpoints to see if the owner node is part of the subtree of any removed nodes and remove ot if so. * UserInterface/Models/DOMBreakpoint.js: (WI.DOMBreakpoint): (WI.DOMBreakpoint.displayNameForType): (WI.DOMBreakpoint.fromJSON): (WI.DOMBreakpoint.prototype.get editable): Added. (WI.DOMBreakpoint.prototype.get domNode): Added. (WI.DOMBreakpoint.prototype.set domNode): Added. (WI.DOMBreakpoint.prototype.get domNodeIdentifier): Deleted. (WI.DOMBreakpoint.prototype.set domNodeIdentifier): Deleted. * UserInterface/Views/DOMTreeContentView.js: (WI.DOMTreeContentView): (WI.DOMTreeContentView.prototype.closed): (WI.DOMTreeContentView.prototype._domTreeElementAdded): (WI.DOMTreeContentView.prototype._domBreakpointAddedOrRemoved): (WI.DOMTreeContentView.prototype._handleDOMBreakpointDisabledStateChanged): (WI.DOMTreeContentView.prototype._handleDOMBreakpointDOMNodeWillChange): Added. (WI.DOMTreeContentView.prototype._handleDOMBreakpointDOMNodeDidChange): Added. (WI.DOMTreeContentView.prototype._updateBreakpointStatus): (WI.DOMTreeContentView.prototype._restoreBreakpointsAfterUpdate): (WI.DOMTreeContentView.prototype._handleDOMBreakpointDOMNodeChanged): Deleted. * UserInterface/Views/SourcesNavigationSidebarPanel.js: (WI.SourcesNavigationSidebarPanel): (WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection): (WI.SourcesNavigationSidebarPanel.prototype._handleDOMBreakpointDOMNodeWillChange): Added. (WI.SourcesNavigationSidebarPanel.prototype._handleDOMBreakpointDOMNodeDidChange): Added. (WI.SourcesNavigationSidebarPanel.prototype._handleDOMBreakpointDOMNodeChanged): Deleted. Use a `WI.DOMNode` instead of an identifier instead of fetching the node for the identifier each time and checking if is valid. LayoutTests: * inspector/debugger/resources/breakpoint-options-utilities.js: (TestPage.registerInitializer.InspectorTest.BreakpointOptions.addTestCases): * inspector/dom-debugger/resources/dom-breakpoint-utilities.js: Added. (TestPage.registerInitializer.InspectorTest.DOMBreakpoint.teardown): (TestPage.registerInitializer.InspectorTest.DOMBreakpoint.createBreakpoint): (TestPage.registerInitializer.InspectorTest.DOMBreakpoint.addBreakpoint): (TestPage.registerInitializer.InspectorTest.DOMBreakpoint.awaitQuerySelector): * inspector/dom-debugger/attribute-modified-style.html: * inspector/dom-debugger/attribute-modified-style-expected.txt: * inspector/dom-debugger/dom-breakpoints.html: * inspector/dom-debugger/dom-breakpoints-expected.txt: * inspector/dom-debugger/dom-breakpoint-attribute-modified.html: Added. * inspector/dom-debugger/dom-breakpoint-attribute-modified-expected.txt: Added. * inspector/dom-debugger/dom-breakpoint-node-removed-ancestor.html: Added. * inspector/dom-debugger/dom-breakpoint-node-removed-ancestor-expected.txt: Added. * inspector/dom-debugger/dom-breakpoint-node-removed-direct.html: Added. * inspector/dom-debugger/dom-breakpoint-node-removed-direct-expected.txt: Added. * inspector/dom-debugger/dom-breakpoint-subtree-modified-add.html: Added. * inspector/dom-debugger/dom-breakpoint-subtree-modified-remove-expected.txt: Added. * inspector/dom-debugger/dom-breakpoint-subtree-modified-remove.html: Added. * inspector/dom-debugger/dom-breakpoint-subtree-modified-add-expected.txt: Added. Canonical link: https://commits.webkit.org/229038@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266669 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-05 20:06:22 +00:00
-- Running test case: DOMBreakpoint.AttributeModified.Options.IgnoreCount
Adding "attribute-modified:1,HTML,1,BODY,1,DIV,0,DIV" DOM Breakpoint...
Setting ignoreCount to '2'...
Triggering breakpoint...
PASS: Should not pause.
Triggering breakpoint...
PASS: Should not pause.
Triggering breakpoint...
PASS: Should pause.
Triggering breakpoint...
PASS: Should pause.
-- Running test case: DOMBreakpoint.AttributeModified.Options.Action.Log
Adding "attribute-modified:1,HTML,1,BODY,1,DIV,0,DIV" DOM Breakpoint...
Adding log action...
Triggering breakpoint...
PASS: Should execute breakpoint action.
PASS: Should pause.
Editing log action...
Triggering breakpoint...
PASS: Should execute breakpoint action.
PASS: Should pause.
Editing log action...
Enabling auto-continue...
Triggering breakpoint...
PASS: Should execute breakpoint action.
PASS: Should not pause.
Editing log action...
Triggering breakpoint...
PASS: Should execute breakpoint action.
PASS: Should not pause.
-- Running test case: DOMBreakpoint.AttributeModified.Options.Actions.Evaluate
Adding "attribute-modified:1,HTML,1,BODY,1,DIV,0,DIV" DOM Breakpoint...
Adding evaluate action...
Triggering breakpoint...
PASS: Should execute breakpoint action.
PASS: Should pause.
Editing evaluate action...
Triggering breakpoint...
PASS: Should execute breakpoint action.
PASS: Should pause.
Editing evaluate action...
Enabling auto-continue...
Triggering breakpoint...
PASS: Should execute breakpoint action.
PASS: Should not pause.
Editing evaluate action...
Triggering breakpoint...
PASS: Should execute breakpoint action.
PASS: Should not pause.
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
-- Running test case: DOMBreakpoint.AttributeModified.Options.Actions.Evaluate.ConsoleCommandLineAPI
Adding saved console value '1'...
Adding "attribute-modified:1,HTML,1,BODY,1,DIV,0,DIV" DOM Breakpoint...
Adding evaluate action using saved console value...
Triggering breakpoint...
PASS: Should execute breakpoint action.
PASS: Should pause.
Adding saved console value '2'...
Editing evaluate action using saved console value...
Triggering breakpoint...
PASS: Should execute breakpoint action.
PASS: Should pause.
Adding saved console value '3'...
Editing evaluate action using saved console value...
Enabling auto-continue...
Triggering breakpoint...
PASS: Should execute breakpoint action.
PASS: Should not pause.
Adding saved console value '4'...
Editing evaluate action using saved console value...
Triggering breakpoint...
PASS: Should execute breakpoint action.
PASS: Should not pause.