haikuwebkit/LayoutTests/inspector/debugger/call-frame-this-nonstrict.html

146 lines
4.4 KiB
HTML
Raw Permalink Normal View History

Change ScriptDebugServer to use DebuggerCallFrame instead of JavaScriptCallFrame. https://bugs.webkit.org/show_bug.cgi?id=121969. Reviewed by Geoffrey Garen. Source/JavaScriptCore: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * debugger/Debugger.cpp: * debugger/Debugger.h: * debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::DebuggerCallFrame): (JSC::DebuggerCallFrame::callerFrame): (JSC::DebuggerCallFrame::dynamicGlobalObject): (JSC::DebuggerCallFrame::sourceId): (JSC::DebuggerCallFrame::functionName): (JSC::DebuggerCallFrame::scope): (JSC::DebuggerCallFrame::type): (JSC::DebuggerCallFrame::thisValue): (JSC::DebuggerCallFrame::evaluate): (JSC::DebuggerCallFrame::evaluateWithCallFrame): (JSC::DebuggerCallFrame::invalidate): (JSC::DebuggerCallFrame::positionForCallFrame): (JSC::DebuggerCallFrame::sourceIdForCallFrame): (JSC::DebuggerCallFrame::thisValueForCallFrame): * debugger/DebuggerCallFrame.h: (JSC::DebuggerCallFrame::create): (JSC::DebuggerCallFrame::exec): (JSC::DebuggerCallFrame::line): (JSC::DebuggerCallFrame::column): (JSC::DebuggerCallFrame::position): (JSC::DebuggerCallFrame::isValid): * interpreter/StackVisitor.cpp: Source/WebCore: Tests: inspector-protocol/debugger/call-frame-function-name.html inspector-protocol/debugger/call-frame-this-host.html inspector-protocol/debugger/call-frame-this-nonstrict.html inspector-protocol/debugger/call-frame-this-strict.html 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::thisObject): * bindings/js/JavaScriptCallFrame.cpp: (WebCore::JavaScriptCallFrame::JavaScriptCallFrame): (WebCore::JavaScriptCallFrame::caller): * bindings/js/JavaScriptCallFrame.h: (WebCore::JavaScriptCallFrame::create): (WebCore::JavaScriptCallFrame::sourceID): (WebCore::JavaScriptCallFrame::position): (WebCore::JavaScriptCallFrame::line): (WebCore::JavaScriptCallFrame::column): (WebCore::JavaScriptCallFrame::functionName): (WebCore::JavaScriptCallFrame::type): (WebCore::JavaScriptCallFrame::scopeChain): (WebCore::JavaScriptCallFrame::dynamicGlobalObject): (WebCore::JavaScriptCallFrame::thisValue): (WebCore::JavaScriptCallFrame::evaluate): * bindings/js/ScriptDebugServer.cpp: (WebCore::DebuggerCallFrameScope::DebuggerCallFrameScope): (WebCore::DebuggerCallFrameScope::~DebuggerCallFrameScope): (WebCore::ScriptDebugServer::ScriptDebugServer): (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): (WebCore::ScriptDebugServer::evaluateBreakpointAction): (WebCore::ScriptDebugServer::breakProgram): (WebCore::ScriptDebugServer::stepOverStatement): (WebCore::ScriptDebugServer::stepOutOfFunction): (WebCore::ScriptDebugServer::currentDebuggerCallFrame): (WebCore::ScriptDebugServer::dispatchDidPause): (WebCore::ScriptDebugServer::updateCallFrame): (WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded): (WebCore::ScriptDebugServer::pauseIfNeeded): (WebCore::ScriptDebugServer::callEvent): (WebCore::ScriptDebugServer::returnEvent): (WebCore::ScriptDebugServer::willExecuteProgram): (WebCore::ScriptDebugServer::didExecuteProgram): * bindings/js/ScriptDebugServer.h: * bindings/js/WorkerScriptDebugServer.cpp: (WebCore::WorkerScriptDebugServer::willExecuteProgram): Source/WebKit/mac: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFramePrivate dealloc]): (-[WebScriptCallFrame _initWithGlobalObject:functionName:exceptionValue:JSC::]): (-[WebScriptCallFrame functionName]): (-[WebScriptCallFrame exception]): * WebView/WebScriptDebugger.mm: (WebScriptDebugger::exception): LayoutTests: * http/tests/inspector/debugger-test.js: (initialize_DebuggerTest): * inspector-protocol/debugger/call-frame-function-name-expected.txt: Added. * inspector-protocol/debugger/call-frame-function-name.html: Added. * inspector-protocol/debugger/call-frame-this-host-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-host.html: Added. * inspector-protocol/debugger/call-frame-this-nonstrict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-nonstrict.html: Added. * inspector-protocol/debugger/call-frame-this-strict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-strict.html: Added. * inspector/debugger/pause-in-internal-script-expected.txt: Canonical link: https://commits.webkit.org/140413@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-05 00:51:31 +00:00
<html>
<head>
Web Inspector: move http/tests/inspector-protocol/ contents to http/tests/inspector/ https://bugs.webkit.org/show_bug.cgi?id=147739 Patch by Brian Burg <bburg@apple.com> on 2015-08-06 Reviewed by Timothy Hatcher. Start merging inspector-protocol/ directory into inspector/, starting with http tests. This patch puts the few http tests into their own domain directories. Files related to the test harness have been moved to the appropriate resources/ directory. Update all inspector tests to the new paths. Lastly, rename InspectorTest.js and protocol-test.html to ProtocolTestStub, to make it obvious that these files are only used by the protocol test harness. * http/tests/inspector/console/access-inspected-object-expected.txt: Renamed from LayoutTests/http/tests/inspector-protocol/access-inspected-object-expected.txt. * http/tests/inspector/console/access-inspected-object.html: Renamed from LayoutTests/http/tests/inspector-protocol/access-inspected-object.html. * http/tests/inspector/css/bad-mime-type.html: * http/tests/inspector/dom/resources/InspectorDOMListener.js: Renamed from LayoutTests/http/tests/inspector-protocol/resources/InspectorDOMListener.js. * http/tests/inspector/page/loading-iframe-document-node-expected.txt: Renamed from LayoutTests/http/tests/inspector-protocol/loading-iframe-document-node-expected.txt. * http/tests/inspector/page/loading-iframe-document-node.html: Renamed from LayoutTests/http/tests/inspector-protocol/loading-iframe-document-node.html. * http/tests/inspector/page/resources/slow-test-page.html: Renamed from LayoutTests/http/tests/inspector-protocol/resources/slow-test-page.html. * http/tests/inspector/page/resources/test-page.html: Renamed from LayoutTests/http/tests/inspector-protocol/resources/test-page.html. * http/tests/inspector/replay/document-last-modified-fallback-value.html: * http/tests/inspector/resources/ProtocolTestStub.html: Renamed from LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html. * http/tests/inspector/resources/ProtocolTestStub.js: Renamed from LayoutTests/http/tests/inspector-protocol/resources/InspectorTest.js. * http/tests/inspector/resources/inspector-test.js: Renamed from LayoutTests/http/tests/inspector/inspector-test.js. * http/tests/inspector/resources/protocol-test.js: Renamed from LayoutTests/http/tests/inspector-protocol/resources/protocol-test.js. * inspector-protocol/async-test-suite.html: * inspector-protocol/console/console-message.html: * inspector-protocol/console/css-source-locations.html: Fix references to console helpers. * inspector-protocol/console/js-source-locations.html: * inspector-protocol/console/x-frame-options-message.html: * inspector-protocol/css/getSupportedCSSProperties.html: * inspector-protocol/debugger/breakpoint-action-detach.html: * inspector-protocol/debugger/breakpoint-action-with-exception.html: * inspector-protocol/debugger/breakpoint-condition-detach.html: * inspector-protocol/debugger/breakpoint-condition-with-bad-script.html: * inspector-protocol/debugger/breakpoint-condition-with-exception.html: * inspector-protocol/debugger/breakpoint-eval-with-exception.html: * inspector-protocol/debugger/breakpoint-inside-conditons-and-actions.html: * inspector-protocol/debugger/call-frame-function-name.html: * inspector-protocol/debugger/call-frame-this-host.html: * inspector-protocol/debugger/call-frame-this-nonstrict.html: * inspector-protocol/debugger/call-frame-this-strict.html: * inspector-protocol/debugger/debugger-statement.html: * inspector-protocol/debugger/didSampleProbe-multiple-probes.html: * inspector-protocol/debugger/hit-breakpoint-from-console.html: * inspector-protocol/debugger/nested-inspectors.html: * inspector-protocol/debugger/pause-dedicated-worker.html: * inspector-protocol/debugger/pause-on-assert.html: * inspector-protocol/debugger/regress-133182.html: * inspector-protocol/debugger/removeBreakpoint.html: * inspector-protocol/debugger/searchInContent-linebreaks.html: * inspector-protocol/debugger/setBreakpoint-actions.html: * inspector-protocol/debugger/setBreakpoint-autoContinue.html: * inspector-protocol/debugger/setBreakpoint-column.html: * inspector-protocol/debugger/setBreakpoint-condition.html: * inspector-protocol/debugger/setBreakpoint-dfg-and-modify-local.html: * inspector-protocol/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html: * inspector-protocol/debugger/setBreakpoint-dfg.html: * inspector-protocol/debugger/setBreakpoint-options-exception.html: * inspector-protocol/debugger/setBreakpoint.html: * inspector-protocol/debugger/setBreakpointByUrl-sourceURL.html: * inspector-protocol/debugger/setPauseOnExceptions-all.html: * inspector-protocol/debugger/setPauseOnExceptions-none.html: * inspector-protocol/debugger/setPauseOnExceptions-uncaught.html: * inspector-protocol/debugger/setVariableValue.html: * inspector-protocol/debugger/terminate-dedicated-worker-while-paused.html: * inspector-protocol/dom-debugger/node-removed.html: * inspector-protocol/dom/dom-remove-events.html: * inspector-protocol/dom/dom-search-crash.html: * inspector-protocol/dom/dom-search-with-context.html: * inspector-protocol/dom/dom-search.html: * inspector-protocol/dom/focus.html: * inspector-protocol/dom/getAccessibilityPropertiesForNode.html: * inspector-protocol/dom/getAccessibilityPropertiesForNode_liveRegion.html: * inspector-protocol/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html: * inspector-protocol/dom/highlight-flow-with-no-region.html: * inspector-protocol/dom/remove-multiple-nodes.html: * inspector-protocol/dom/request-child-nodes-depth.html: * inspector-protocol/layers/layers-anonymous.html: * inspector-protocol/layers/layers-blending-compositing-reasons.html: * inspector-protocol/layers/layers-compositing-reasons.html: * inspector-protocol/layers/layers-for-node.html: * inspector-protocol/layers/layers-generated-content.html: * inspector-protocol/layers/layers-reflected-content.html: * inspector-protocol/page/archive.html: * inspector-protocol/page/frameScheduledNavigation.html: * inspector-protocol/page/frameStartedLoading.html: * inspector-protocol/page/javascriptDialogEvents.html: * inspector-protocol/page/setEmulatedMedia.html: * inspector-protocol/runtime/getProperties.html: * inspector-protocol/sync-test-suite.html: * inspector/console/command-line-api.html: * inspector/console/console-api.html: * inspector/console/console-table.html: * inspector/css/get-system-fonts.html: * inspector/css/matched-style-properties.html: * inspector/css/modify-rule-selector.html: * inspector/css/pseudo-element-matches-for-pseudo-element-node.html: * inspector/css/pseudo-element-matches.html: * inspector/css/selector-dynamic-specificity.html: * inspector/css/selector-specificity.html: * inspector/css/stylesheet-with-mutations.html: * inspector/debugger/break-on-exception-catch.html: * inspector/debugger/break-on-exception-finally.html: * inspector/debugger/break-on-exception-native.html: * inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch.html: * inspector/debugger/break-on-exception-throw-in-promise-then-with-catch.html: * inspector/debugger/break-on-exception-throw-in-promise-then.html: * inspector/debugger/break-on-exception-throw-in-promise-with-catch.html: * inspector/debugger/break-on-exception-throw-in-promise.html: * inspector/debugger/break-on-exception-window-onerror.html: * inspector/debugger/break-on-exception.html: * inspector/debugger/break-on-uncaught-exception-catch.html: * inspector/debugger/break-on-uncaught-exception-finally.html: * inspector/debugger/break-on-uncaught-exception-native.html: * inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch.html: * inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch.html: * inspector/debugger/break-on-uncaught-exception-throw-in-promise-then.html: * inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch.html: * inspector/debugger/break-on-uncaught-exception-throw-in-promise.html: * inspector/debugger/break-on-uncaught-exception-window-onerror.html: * inspector/debugger/break-on-uncaught-exception.html: * inspector/debugger/breakpoint-action-eval.html: * inspector/debugger/breakpoint-columns.html: * inspector/debugger/breakpoint-scope.html: * inspector/debugger/command-line-api-exception-nested-catch.html: * inspector/debugger/command-line-api-exception.html: * inspector/debugger/js-stacktrace.html: * inspector/debugger/pause-reason.html: * inspector/debugger/probe-manager-add-remove-actions.html: * inspector/debugger/search-scripts-expected.txt: * inspector/debugger/search-scripts.html: * inspector/dom/content-flow-content-nodes.html: * inspector/dom/content-flow-content-removal.html: * inspector/dom/content-flow-list.html: * inspector/dom/content-node-region-info.html: * inspector/dom/highlight-shape-outside-margin.html: * inspector/dom/highlight-shape-outside.html: * inspector/dom/highlightSelector.html: * inspector/dom/pseudo-element-dynamic.html: * inspector/dom/pseudo-element-static.html: * inspector/dom/template-content.html: * inspector/event-listener-set.html: * inspector/event-listener.html: * inspector/model/parse-script-syntax-tree.html: * inspector/model/remote-object-get-properties.html: * inspector/model/remote-object-weak-collection.html: * inspector/model/remote-object.html: * inspector/page/main-frame-resource.html: * inspector/protocol-promise-result.html: * inspector/replay/javascript-date-now.html: * inspector/replay/javascript-random-seed.html: * inspector/replay/window-navigator-plugins-memoized.html: * inspector/test-harness-trivially-works.html: * inspector/timeline/debugger-paused-while-recording.html: * inspector/timeline/exception-in-injected-script-while-recording.html: * inspector/timeline/recording-start-stop-timestamps.html: * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/ios-simulator-wk1/TestExpectations: * platform/ios-simulator-wk2/TestExpectations: Canonical link: https://commits.webkit.org/165829@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188059 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-08-06 21:17:03 +00:00
<script src="../../http/tests/inspector/resources/protocol-test.js"></script>
Change ScriptDebugServer to use DebuggerCallFrame instead of JavaScriptCallFrame. https://bugs.webkit.org/show_bug.cgi?id=121969. Reviewed by Geoffrey Garen. Source/JavaScriptCore: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * debugger/Debugger.cpp: * debugger/Debugger.h: * debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::DebuggerCallFrame): (JSC::DebuggerCallFrame::callerFrame): (JSC::DebuggerCallFrame::dynamicGlobalObject): (JSC::DebuggerCallFrame::sourceId): (JSC::DebuggerCallFrame::functionName): (JSC::DebuggerCallFrame::scope): (JSC::DebuggerCallFrame::type): (JSC::DebuggerCallFrame::thisValue): (JSC::DebuggerCallFrame::evaluate): (JSC::DebuggerCallFrame::evaluateWithCallFrame): (JSC::DebuggerCallFrame::invalidate): (JSC::DebuggerCallFrame::positionForCallFrame): (JSC::DebuggerCallFrame::sourceIdForCallFrame): (JSC::DebuggerCallFrame::thisValueForCallFrame): * debugger/DebuggerCallFrame.h: (JSC::DebuggerCallFrame::create): (JSC::DebuggerCallFrame::exec): (JSC::DebuggerCallFrame::line): (JSC::DebuggerCallFrame::column): (JSC::DebuggerCallFrame::position): (JSC::DebuggerCallFrame::isValid): * interpreter/StackVisitor.cpp: Source/WebCore: Tests: inspector-protocol/debugger/call-frame-function-name.html inspector-protocol/debugger/call-frame-this-host.html inspector-protocol/debugger/call-frame-this-nonstrict.html inspector-protocol/debugger/call-frame-this-strict.html 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::thisObject): * bindings/js/JavaScriptCallFrame.cpp: (WebCore::JavaScriptCallFrame::JavaScriptCallFrame): (WebCore::JavaScriptCallFrame::caller): * bindings/js/JavaScriptCallFrame.h: (WebCore::JavaScriptCallFrame::create): (WebCore::JavaScriptCallFrame::sourceID): (WebCore::JavaScriptCallFrame::position): (WebCore::JavaScriptCallFrame::line): (WebCore::JavaScriptCallFrame::column): (WebCore::JavaScriptCallFrame::functionName): (WebCore::JavaScriptCallFrame::type): (WebCore::JavaScriptCallFrame::scopeChain): (WebCore::JavaScriptCallFrame::dynamicGlobalObject): (WebCore::JavaScriptCallFrame::thisValue): (WebCore::JavaScriptCallFrame::evaluate): * bindings/js/ScriptDebugServer.cpp: (WebCore::DebuggerCallFrameScope::DebuggerCallFrameScope): (WebCore::DebuggerCallFrameScope::~DebuggerCallFrameScope): (WebCore::ScriptDebugServer::ScriptDebugServer): (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): (WebCore::ScriptDebugServer::evaluateBreakpointAction): (WebCore::ScriptDebugServer::breakProgram): (WebCore::ScriptDebugServer::stepOverStatement): (WebCore::ScriptDebugServer::stepOutOfFunction): (WebCore::ScriptDebugServer::currentDebuggerCallFrame): (WebCore::ScriptDebugServer::dispatchDidPause): (WebCore::ScriptDebugServer::updateCallFrame): (WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded): (WebCore::ScriptDebugServer::pauseIfNeeded): (WebCore::ScriptDebugServer::callEvent): (WebCore::ScriptDebugServer::returnEvent): (WebCore::ScriptDebugServer::willExecuteProgram): (WebCore::ScriptDebugServer::didExecuteProgram): * bindings/js/ScriptDebugServer.h: * bindings/js/WorkerScriptDebugServer.cpp: (WebCore::WorkerScriptDebugServer::willExecuteProgram): Source/WebKit/mac: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFramePrivate dealloc]): (-[WebScriptCallFrame _initWithGlobalObject:functionName:exceptionValue:JSC::]): (-[WebScriptCallFrame functionName]): (-[WebScriptCallFrame exception]): * WebView/WebScriptDebugger.mm: (WebScriptDebugger::exception): LayoutTests: * http/tests/inspector/debugger-test.js: (initialize_DebuggerTest): * inspector-protocol/debugger/call-frame-function-name-expected.txt: Added. * inspector-protocol/debugger/call-frame-function-name.html: Added. * inspector-protocol/debugger/call-frame-this-host-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-host.html: Added. * inspector-protocol/debugger/call-frame-this-nonstrict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-nonstrict.html: Added. * inspector-protocol/debugger/call-frame-this-strict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-strict.html: Added. * inspector/debugger/pause-in-internal-script-expected.txt: Canonical link: https://commits.webkit.org/140413@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-05 00:51:31 +00:00
<script>
// Put this here instead of on <body onload> to prevent an extra Debugger.scriptParsed event.
window.onload = runTest;
function test()
{
// This test sets a breakpoint on line:column in the <script> below.
// We set a breakpoint before evaluating 'sum += ...', and verify that
// call frame this values are what we expect.
Web Inspector: use different namespaces in test fixtures for protocol tests and frontend tests https://bugs.webkit.org/show_bug.cgi?id=147787 Patch by Brian Burg <bburg@apple.com> on 2015-08-11 Reviewed by Timothy Hatcher. Refactor test methods to use three distinct namespaces to reflect their implementation: - InspectorProtocol contains commands that are only used from within protocol tests. This includes sending and receiving protocol messages and checking message errors. - InspectorTest contains test methods for full inspector frontend tests. - ProtocolTest contains test methods for protocol tests. In a subsequent patch, most methods in InspectorTest and ProtocolTest namespaces will be unified so that implementations of log, assert, etc. are no longer duplicated. For now, at least make it obvious at each callsite what code is being invoked. * http/tests/inspector/console/access-inspected-object.html: * http/tests/inspector/dom/resources/InspectorDOMListener.js: * http/tests/inspector/page/loading-iframe-document-node.html: * http/tests/inspector/resources/ProtocolTestStub.js: * http/tests/inspector/resources/console-test.js: * http/tests/inspector/resources/probe-test.js: * inspector/console/console-message.html: * inspector/console/css-source-locations.html: * inspector/console/js-source-locations.html: * inspector/console/x-frame-options-message.html: * inspector/css/getSupportedCSSProperties.html: * inspector/debugger/breakpoint-action-detach.html: * inspector/debugger/breakpoint-action-with-exception.html: * inspector/debugger/breakpoint-condition-detach.html: * inspector/debugger/breakpoint-condition-with-bad-script.html: * inspector/debugger/breakpoint-condition-with-exception.html: * inspector/debugger/breakpoint-eval-with-exception.html: * inspector/debugger/breakpoint-inside-conditons-and-actions.html: * inspector/debugger/call-frame-function-name.html: * inspector/debugger/call-frame-this-host.html: * inspector/debugger/call-frame-this-nonstrict.html: * inspector/debugger/call-frame-this-strict.html: * inspector/debugger/debugger-statement.html: * inspector/debugger/didSampleProbe-multiple-probes.html: * inspector/debugger/hit-breakpoint-from-console.html: * inspector/debugger/nested-inspectors.html: * inspector/debugger/pause-dedicated-worker.html: * inspector/debugger/pause-on-assert.html: * inspector/debugger/regress-133182.html: * inspector/debugger/removeBreakpoint.html: * inspector/debugger/searchInContent-linebreaks.html: * inspector/debugger/setBreakpoint-actions.html: * inspector/debugger/setBreakpoint-autoContinue.html: * inspector/debugger/setBreakpoint-column.html: * inspector/debugger/setBreakpoint-condition.html: * inspector/debugger/setBreakpoint-dfg-and-modify-local.html: * inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html: * inspector/debugger/setBreakpoint-dfg.html: * inspector/debugger/setBreakpoint-options-exception.html: * inspector/debugger/setBreakpoint.html: * inspector/debugger/setBreakpointByUrl-sourceURL.html: * inspector/debugger/setPauseOnExceptions-all.html: * inspector/debugger/setPauseOnExceptions-none.html: * inspector/debugger/setPauseOnExceptions-uncaught.html: * inspector/debugger/setVariableValue.html: * inspector/debugger/terminate-dedicated-worker-while-paused.html: * inspector/dom-debugger/node-removed.html: * inspector/dom/dom-remove-events.html: * inspector/dom/dom-search-crash.html: * inspector/dom/dom-search-with-context.html: * inspector/dom/dom-search.html: * inspector/dom/focus.html: * inspector/dom/getAccessibilityPropertiesForNode.html: * inspector/dom/getAccessibilityPropertiesForNode_liveRegion.html: * inspector/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html: * inspector/dom/highlight-flow-with-no-region.html: * inspector/dom/remove-multiple-nodes.html: * inspector/dom/request-child-nodes-depth.html: * inspector/layers/layers-anonymous.html: * inspector/layers/layers-blending-compositing-reasons.html: * inspector/layers/layers-compositing-reasons.html: * inspector/layers/layers-for-node.html: * inspector/layers/layers-generated-content.html: * inspector/layers/layers-reflected-content.html: * inspector/page/archive.html: * inspector/page/frameScheduledNavigation.html: * inspector/page/frameStartedLoading.html: * inspector/page/javascriptDialogEvents.html: * inspector/page/setEmulatedMedia.html: * inspector/runtime/getProperties.html: * inspector/unit-tests/async-test-suite.html: * inspector/unit-tests/sync-test-suite.html: Canonical link: https://commits.webkit.org/165990@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-08-11 18:28:31 +00:00
InspectorProtocol.sendCommand("Debugger.enable", {});
Web Inspector: Cleanup inspector/debugger tests https://bugs.webkit.org/show_bug.cgi?id=156619 Reviewed by Brian Burg. Source/JavaScriptCore: While cleaning up the tests it exposed the fact that breakpoints were not getting disabled when the inspector closes. This means that opening the inspector, with breakpoints, and closing the inspector, would leave the JSC::Debugger thinking breakpoints are active. The JSC::Debugger should be reset. * inspector/agents/InspectorDebuggerAgent.cpp: (Inspector::InspectorDebuggerAgent::disable): Source/WebInspectorUI: * UserInterface/Base/Main.js: (WebInspector.loaded): * UserInterface/Controllers/DebuggerManager.js: Remove agent checks for agents that are always available. LayoutTests: * inspector/debugger/breakpoint-action-detach.html: * inspector/debugger/breakpoint-action-with-exception.html: * inspector/debugger/breakpoint-condition-detach.html: * inspector/debugger/breakpoint-condition-with-bad-script.html: * inspector/debugger/breakpoint-condition-with-exception.html: * inspector/debugger/breakpoint-eval-with-exception.html: * inspector/debugger/breakpoint-inside-conditons-and-actions.html: * inspector/debugger/call-frame-function-name.html: * inspector/debugger/call-frame-this-host.html: * inspector/debugger/call-frame-this-nonstrict.html: * inspector/debugger/call-frame-this-strict.html: * inspector/debugger/debugger-statement.html: * inspector/debugger/didSampleProbe-multiple-probes.html: * inspector/debugger/hit-breakpoint-from-console.html: * inspector/debugger/nested-inspectors.html: * inspector/debugger/pause-on-assert.html: * inspector/debugger/regress-133182.html: * inspector/debugger/removeBreakpoint.html: * inspector/debugger/setBreakpoint-actions.html: * inspector/debugger/setBreakpoint-autoContinue.html: * inspector/debugger/setBreakpoint-column.html: * inspector/debugger/setBreakpoint-condition.html: * inspector/debugger/setBreakpoint-dfg-and-modify-local.html: * inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html: * inspector/debugger/setBreakpoint-dfg.html: * inspector/debugger/setBreakpoint-options-exception.html: * inspector/debugger/setBreakpoint.html: * inspector/debugger/setBreakpointByUrl-sourceURL.html: * inspector/debugger/setPauseOnExceptions-all.html: * inspector/debugger/setPauseOnExceptions-none.html: * inspector/debugger/setPauseOnExceptions-uncaught.html: Activate breakpoints in protocol tests that may set breakpoints and pause. Inspector tests automatically enable breakpoints. * inspector/debugger/setVariableValue-expected.txt: Removed. * inspector/debugger/setVariableValue.html: Removed. * platform/gtk/TestExpectations: Remove references to bad test. The protocol command no longer exists. Canonical link: https://commits.webkit.org/174732@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199592 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-15 17:18:12 +00:00
InspectorProtocol.sendCommand("Debugger.setBreakpointsActive", {active: true});
Change ScriptDebugServer to use DebuggerCallFrame instead of JavaScriptCallFrame. https://bugs.webkit.org/show_bug.cgi?id=121969. Reviewed by Geoffrey Garen. Source/JavaScriptCore: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * debugger/Debugger.cpp: * debugger/Debugger.h: * debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::DebuggerCallFrame): (JSC::DebuggerCallFrame::callerFrame): (JSC::DebuggerCallFrame::dynamicGlobalObject): (JSC::DebuggerCallFrame::sourceId): (JSC::DebuggerCallFrame::functionName): (JSC::DebuggerCallFrame::scope): (JSC::DebuggerCallFrame::type): (JSC::DebuggerCallFrame::thisValue): (JSC::DebuggerCallFrame::evaluate): (JSC::DebuggerCallFrame::evaluateWithCallFrame): (JSC::DebuggerCallFrame::invalidate): (JSC::DebuggerCallFrame::positionForCallFrame): (JSC::DebuggerCallFrame::sourceIdForCallFrame): (JSC::DebuggerCallFrame::thisValueForCallFrame): * debugger/DebuggerCallFrame.h: (JSC::DebuggerCallFrame::create): (JSC::DebuggerCallFrame::exec): (JSC::DebuggerCallFrame::line): (JSC::DebuggerCallFrame::column): (JSC::DebuggerCallFrame::position): (JSC::DebuggerCallFrame::isValid): * interpreter/StackVisitor.cpp: Source/WebCore: Tests: inspector-protocol/debugger/call-frame-function-name.html inspector-protocol/debugger/call-frame-this-host.html inspector-protocol/debugger/call-frame-this-nonstrict.html inspector-protocol/debugger/call-frame-this-strict.html 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::thisObject): * bindings/js/JavaScriptCallFrame.cpp: (WebCore::JavaScriptCallFrame::JavaScriptCallFrame): (WebCore::JavaScriptCallFrame::caller): * bindings/js/JavaScriptCallFrame.h: (WebCore::JavaScriptCallFrame::create): (WebCore::JavaScriptCallFrame::sourceID): (WebCore::JavaScriptCallFrame::position): (WebCore::JavaScriptCallFrame::line): (WebCore::JavaScriptCallFrame::column): (WebCore::JavaScriptCallFrame::functionName): (WebCore::JavaScriptCallFrame::type): (WebCore::JavaScriptCallFrame::scopeChain): (WebCore::JavaScriptCallFrame::dynamicGlobalObject): (WebCore::JavaScriptCallFrame::thisValue): (WebCore::JavaScriptCallFrame::evaluate): * bindings/js/ScriptDebugServer.cpp: (WebCore::DebuggerCallFrameScope::DebuggerCallFrameScope): (WebCore::DebuggerCallFrameScope::~DebuggerCallFrameScope): (WebCore::ScriptDebugServer::ScriptDebugServer): (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): (WebCore::ScriptDebugServer::evaluateBreakpointAction): (WebCore::ScriptDebugServer::breakProgram): (WebCore::ScriptDebugServer::stepOverStatement): (WebCore::ScriptDebugServer::stepOutOfFunction): (WebCore::ScriptDebugServer::currentDebuggerCallFrame): (WebCore::ScriptDebugServer::dispatchDidPause): (WebCore::ScriptDebugServer::updateCallFrame): (WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded): (WebCore::ScriptDebugServer::pauseIfNeeded): (WebCore::ScriptDebugServer::callEvent): (WebCore::ScriptDebugServer::returnEvent): (WebCore::ScriptDebugServer::willExecuteProgram): (WebCore::ScriptDebugServer::didExecuteProgram): * bindings/js/ScriptDebugServer.h: * bindings/js/WorkerScriptDebugServer.cpp: (WebCore::WorkerScriptDebugServer::willExecuteProgram): Source/WebKit/mac: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFramePrivate dealloc]): (-[WebScriptCallFrame _initWithGlobalObject:functionName:exceptionValue:JSC::]): (-[WebScriptCallFrame functionName]): (-[WebScriptCallFrame exception]): * WebView/WebScriptDebugger.mm: (WebScriptDebugger::exception): LayoutTests: * http/tests/inspector/debugger-test.js: (initialize_DebuggerTest): * inspector-protocol/debugger/call-frame-function-name-expected.txt: Added. * inspector-protocol/debugger/call-frame-function-name.html: Added. * inspector-protocol/debugger/call-frame-this-host-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-host.html: Added. * inspector-protocol/debugger/call-frame-this-nonstrict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-nonstrict.html: Added. * inspector-protocol/debugger/call-frame-this-strict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-strict.html: Added. * inspector/debugger/pause-in-internal-script-expected.txt: Canonical link: https://commits.webkit.org/140413@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-05 00:51:31 +00:00
Web Inspector: use different namespaces in test fixtures for protocol tests and frontend tests https://bugs.webkit.org/show_bug.cgi?id=147787 Patch by Brian Burg <bburg@apple.com> on 2015-08-11 Reviewed by Timothy Hatcher. Refactor test methods to use three distinct namespaces to reflect their implementation: - InspectorProtocol contains commands that are only used from within protocol tests. This includes sending and receiving protocol messages and checking message errors. - InspectorTest contains test methods for full inspector frontend tests. - ProtocolTest contains test methods for protocol tests. In a subsequent patch, most methods in InspectorTest and ProtocolTest namespaces will be unified so that implementations of log, assert, etc. are no longer duplicated. For now, at least make it obvious at each callsite what code is being invoked. * http/tests/inspector/console/access-inspected-object.html: * http/tests/inspector/dom/resources/InspectorDOMListener.js: * http/tests/inspector/page/loading-iframe-document-node.html: * http/tests/inspector/resources/ProtocolTestStub.js: * http/tests/inspector/resources/console-test.js: * http/tests/inspector/resources/probe-test.js: * inspector/console/console-message.html: * inspector/console/css-source-locations.html: * inspector/console/js-source-locations.html: * inspector/console/x-frame-options-message.html: * inspector/css/getSupportedCSSProperties.html: * inspector/debugger/breakpoint-action-detach.html: * inspector/debugger/breakpoint-action-with-exception.html: * inspector/debugger/breakpoint-condition-detach.html: * inspector/debugger/breakpoint-condition-with-bad-script.html: * inspector/debugger/breakpoint-condition-with-exception.html: * inspector/debugger/breakpoint-eval-with-exception.html: * inspector/debugger/breakpoint-inside-conditons-and-actions.html: * inspector/debugger/call-frame-function-name.html: * inspector/debugger/call-frame-this-host.html: * inspector/debugger/call-frame-this-nonstrict.html: * inspector/debugger/call-frame-this-strict.html: * inspector/debugger/debugger-statement.html: * inspector/debugger/didSampleProbe-multiple-probes.html: * inspector/debugger/hit-breakpoint-from-console.html: * inspector/debugger/nested-inspectors.html: * inspector/debugger/pause-dedicated-worker.html: * inspector/debugger/pause-on-assert.html: * inspector/debugger/regress-133182.html: * inspector/debugger/removeBreakpoint.html: * inspector/debugger/searchInContent-linebreaks.html: * inspector/debugger/setBreakpoint-actions.html: * inspector/debugger/setBreakpoint-autoContinue.html: * inspector/debugger/setBreakpoint-column.html: * inspector/debugger/setBreakpoint-condition.html: * inspector/debugger/setBreakpoint-dfg-and-modify-local.html: * inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html: * inspector/debugger/setBreakpoint-dfg.html: * inspector/debugger/setBreakpoint-options-exception.html: * inspector/debugger/setBreakpoint.html: * inspector/debugger/setBreakpointByUrl-sourceURL.html: * inspector/debugger/setPauseOnExceptions-all.html: * inspector/debugger/setPauseOnExceptions-none.html: * inspector/debugger/setPauseOnExceptions-uncaught.html: * inspector/debugger/setVariableValue.html: * inspector/debugger/terminate-dedicated-worker-while-paused.html: * inspector/dom-debugger/node-removed.html: * inspector/dom/dom-remove-events.html: * inspector/dom/dom-search-crash.html: * inspector/dom/dom-search-with-context.html: * inspector/dom/dom-search.html: * inspector/dom/focus.html: * inspector/dom/getAccessibilityPropertiesForNode.html: * inspector/dom/getAccessibilityPropertiesForNode_liveRegion.html: * inspector/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html: * inspector/dom/highlight-flow-with-no-region.html: * inspector/dom/remove-multiple-nodes.html: * inspector/dom/request-child-nodes-depth.html: * inspector/layers/layers-anonymous.html: * inspector/layers/layers-blending-compositing-reasons.html: * inspector/layers/layers-compositing-reasons.html: * inspector/layers/layers-for-node.html: * inspector/layers/layers-generated-content.html: * inspector/layers/layers-reflected-content.html: * inspector/page/archive.html: * inspector/page/frameScheduledNavigation.html: * inspector/page/frameStartedLoading.html: * inspector/page/javascriptDialogEvents.html: * inspector/page/setEmulatedMedia.html: * inspector/runtime/getProperties.html: * inspector/unit-tests/async-test-suite.html: * inspector/unit-tests/sync-test-suite.html: Canonical link: https://commits.webkit.org/165990@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-08-11 18:28:31 +00:00
InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
Change ScriptDebugServer to use DebuggerCallFrame instead of JavaScriptCallFrame. https://bugs.webkit.org/show_bug.cgi?id=121969. Reviewed by Geoffrey Garen. Source/JavaScriptCore: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * debugger/Debugger.cpp: * debugger/Debugger.h: * debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::DebuggerCallFrame): (JSC::DebuggerCallFrame::callerFrame): (JSC::DebuggerCallFrame::dynamicGlobalObject): (JSC::DebuggerCallFrame::sourceId): (JSC::DebuggerCallFrame::functionName): (JSC::DebuggerCallFrame::scope): (JSC::DebuggerCallFrame::type): (JSC::DebuggerCallFrame::thisValue): (JSC::DebuggerCallFrame::evaluate): (JSC::DebuggerCallFrame::evaluateWithCallFrame): (JSC::DebuggerCallFrame::invalidate): (JSC::DebuggerCallFrame::positionForCallFrame): (JSC::DebuggerCallFrame::sourceIdForCallFrame): (JSC::DebuggerCallFrame::thisValueForCallFrame): * debugger/DebuggerCallFrame.h: (JSC::DebuggerCallFrame::create): (JSC::DebuggerCallFrame::exec): (JSC::DebuggerCallFrame::line): (JSC::DebuggerCallFrame::column): (JSC::DebuggerCallFrame::position): (JSC::DebuggerCallFrame::isValid): * interpreter/StackVisitor.cpp: Source/WebCore: Tests: inspector-protocol/debugger/call-frame-function-name.html inspector-protocol/debugger/call-frame-this-host.html inspector-protocol/debugger/call-frame-this-nonstrict.html inspector-protocol/debugger/call-frame-this-strict.html 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::thisObject): * bindings/js/JavaScriptCallFrame.cpp: (WebCore::JavaScriptCallFrame::JavaScriptCallFrame): (WebCore::JavaScriptCallFrame::caller): * bindings/js/JavaScriptCallFrame.h: (WebCore::JavaScriptCallFrame::create): (WebCore::JavaScriptCallFrame::sourceID): (WebCore::JavaScriptCallFrame::position): (WebCore::JavaScriptCallFrame::line): (WebCore::JavaScriptCallFrame::column): (WebCore::JavaScriptCallFrame::functionName): (WebCore::JavaScriptCallFrame::type): (WebCore::JavaScriptCallFrame::scopeChain): (WebCore::JavaScriptCallFrame::dynamicGlobalObject): (WebCore::JavaScriptCallFrame::thisValue): (WebCore::JavaScriptCallFrame::evaluate): * bindings/js/ScriptDebugServer.cpp: (WebCore::DebuggerCallFrameScope::DebuggerCallFrameScope): (WebCore::DebuggerCallFrameScope::~DebuggerCallFrameScope): (WebCore::ScriptDebugServer::ScriptDebugServer): (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): (WebCore::ScriptDebugServer::evaluateBreakpointAction): (WebCore::ScriptDebugServer::breakProgram): (WebCore::ScriptDebugServer::stepOverStatement): (WebCore::ScriptDebugServer::stepOutOfFunction): (WebCore::ScriptDebugServer::currentDebuggerCallFrame): (WebCore::ScriptDebugServer::dispatchDidPause): (WebCore::ScriptDebugServer::updateCallFrame): (WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded): (WebCore::ScriptDebugServer::pauseIfNeeded): (WebCore::ScriptDebugServer::callEvent): (WebCore::ScriptDebugServer::returnEvent): (WebCore::ScriptDebugServer::willExecuteProgram): (WebCore::ScriptDebugServer::didExecuteProgram): * bindings/js/ScriptDebugServer.h: * bindings/js/WorkerScriptDebugServer.cpp: (WebCore::WorkerScriptDebugServer::willExecuteProgram): Source/WebKit/mac: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFramePrivate dealloc]): (-[WebScriptCallFrame _initWithGlobalObject:functionName:exceptionValue:JSC::]): (-[WebScriptCallFrame functionName]): (-[WebScriptCallFrame exception]): * WebView/WebScriptDebugger.mm: (WebScriptDebugger::exception): LayoutTests: * http/tests/inspector/debugger-test.js: (initialize_DebuggerTest): * inspector-protocol/debugger/call-frame-function-name-expected.txt: Added. * inspector-protocol/debugger/call-frame-function-name.html: Added. * inspector-protocol/debugger/call-frame-this-host-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-host.html: Added. * inspector-protocol/debugger/call-frame-this-nonstrict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-nonstrict.html: Added. * inspector-protocol/debugger/call-frame-this-strict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-strict.html: Added. * inspector/debugger/pause-in-internal-script-expected.txt: Canonical link: https://commits.webkit.org/140413@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-05 00:51:31 +00:00
{
if (/call-frame-this-nonstrict\.html$/.test(messageObject.params.url) && messageObject.params.startLine > 10) {
Web Inspector: use different namespaces in test fixtures for protocol tests and frontend tests https://bugs.webkit.org/show_bug.cgi?id=147787 Patch by Brian Burg <bburg@apple.com> on 2015-08-11 Reviewed by Timothy Hatcher. Refactor test methods to use three distinct namespaces to reflect their implementation: - InspectorProtocol contains commands that are only used from within protocol tests. This includes sending and receiving protocol messages and checking message errors. - InspectorTest contains test methods for full inspector frontend tests. - ProtocolTest contains test methods for protocol tests. In a subsequent patch, most methods in InspectorTest and ProtocolTest namespaces will be unified so that implementations of log, assert, etc. are no longer duplicated. For now, at least make it obvious at each callsite what code is being invoked. * http/tests/inspector/console/access-inspected-object.html: * http/tests/inspector/dom/resources/InspectorDOMListener.js: * http/tests/inspector/page/loading-iframe-document-node.html: * http/tests/inspector/resources/ProtocolTestStub.js: * http/tests/inspector/resources/console-test.js: * http/tests/inspector/resources/probe-test.js: * inspector/console/console-message.html: * inspector/console/css-source-locations.html: * inspector/console/js-source-locations.html: * inspector/console/x-frame-options-message.html: * inspector/css/getSupportedCSSProperties.html: * inspector/debugger/breakpoint-action-detach.html: * inspector/debugger/breakpoint-action-with-exception.html: * inspector/debugger/breakpoint-condition-detach.html: * inspector/debugger/breakpoint-condition-with-bad-script.html: * inspector/debugger/breakpoint-condition-with-exception.html: * inspector/debugger/breakpoint-eval-with-exception.html: * inspector/debugger/breakpoint-inside-conditons-and-actions.html: * inspector/debugger/call-frame-function-name.html: * inspector/debugger/call-frame-this-host.html: * inspector/debugger/call-frame-this-nonstrict.html: * inspector/debugger/call-frame-this-strict.html: * inspector/debugger/debugger-statement.html: * inspector/debugger/didSampleProbe-multiple-probes.html: * inspector/debugger/hit-breakpoint-from-console.html: * inspector/debugger/nested-inspectors.html: * inspector/debugger/pause-dedicated-worker.html: * inspector/debugger/pause-on-assert.html: * inspector/debugger/regress-133182.html: * inspector/debugger/removeBreakpoint.html: * inspector/debugger/searchInContent-linebreaks.html: * inspector/debugger/setBreakpoint-actions.html: * inspector/debugger/setBreakpoint-autoContinue.html: * inspector/debugger/setBreakpoint-column.html: * inspector/debugger/setBreakpoint-condition.html: * inspector/debugger/setBreakpoint-dfg-and-modify-local.html: * inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html: * inspector/debugger/setBreakpoint-dfg.html: * inspector/debugger/setBreakpoint-options-exception.html: * inspector/debugger/setBreakpoint.html: * inspector/debugger/setBreakpointByUrl-sourceURL.html: * inspector/debugger/setPauseOnExceptions-all.html: * inspector/debugger/setPauseOnExceptions-none.html: * inspector/debugger/setPauseOnExceptions-uncaught.html: * inspector/debugger/setVariableValue.html: * inspector/debugger/terminate-dedicated-worker-while-paused.html: * inspector/dom-debugger/node-removed.html: * inspector/dom/dom-remove-events.html: * inspector/dom/dom-search-crash.html: * inspector/dom/dom-search-with-context.html: * inspector/dom/dom-search.html: * inspector/dom/focus.html: * inspector/dom/getAccessibilityPropertiesForNode.html: * inspector/dom/getAccessibilityPropertiesForNode_liveRegion.html: * inspector/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html: * inspector/dom/highlight-flow-with-no-region.html: * inspector/dom/remove-multiple-nodes.html: * inspector/dom/request-child-nodes-depth.html: * inspector/layers/layers-anonymous.html: * inspector/layers/layers-blending-compositing-reasons.html: * inspector/layers/layers-compositing-reasons.html: * inspector/layers/layers-for-node.html: * inspector/layers/layers-generated-content.html: * inspector/layers/layers-reflected-content.html: * inspector/page/archive.html: * inspector/page/frameScheduledNavigation.html: * inspector/page/frameStartedLoading.html: * inspector/page/javascriptDialogEvents.html: * inspector/page/setEmulatedMedia.html: * inspector/runtime/getProperties.html: * inspector/unit-tests/async-test-suite.html: * inspector/unit-tests/sync-test-suite.html: Canonical link: https://commits.webkit.org/165990@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-08-11 18:28:31 +00:00
ProtocolTest.log("Found <script>");
Change ScriptDebugServer to use DebuggerCallFrame instead of JavaScriptCallFrame. https://bugs.webkit.org/show_bug.cgi?id=121969. Reviewed by Geoffrey Garen. Source/JavaScriptCore: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * debugger/Debugger.cpp: * debugger/Debugger.h: * debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::DebuggerCallFrame): (JSC::DebuggerCallFrame::callerFrame): (JSC::DebuggerCallFrame::dynamicGlobalObject): (JSC::DebuggerCallFrame::sourceId): (JSC::DebuggerCallFrame::functionName): (JSC::DebuggerCallFrame::scope): (JSC::DebuggerCallFrame::type): (JSC::DebuggerCallFrame::thisValue): (JSC::DebuggerCallFrame::evaluate): (JSC::DebuggerCallFrame::evaluateWithCallFrame): (JSC::DebuggerCallFrame::invalidate): (JSC::DebuggerCallFrame::positionForCallFrame): (JSC::DebuggerCallFrame::sourceIdForCallFrame): (JSC::DebuggerCallFrame::thisValueForCallFrame): * debugger/DebuggerCallFrame.h: (JSC::DebuggerCallFrame::create): (JSC::DebuggerCallFrame::exec): (JSC::DebuggerCallFrame::line): (JSC::DebuggerCallFrame::column): (JSC::DebuggerCallFrame::position): (JSC::DebuggerCallFrame::isValid): * interpreter/StackVisitor.cpp: Source/WebCore: Tests: inspector-protocol/debugger/call-frame-function-name.html inspector-protocol/debugger/call-frame-this-host.html inspector-protocol/debugger/call-frame-this-nonstrict.html inspector-protocol/debugger/call-frame-this-strict.html 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::thisObject): * bindings/js/JavaScriptCallFrame.cpp: (WebCore::JavaScriptCallFrame::JavaScriptCallFrame): (WebCore::JavaScriptCallFrame::caller): * bindings/js/JavaScriptCallFrame.h: (WebCore::JavaScriptCallFrame::create): (WebCore::JavaScriptCallFrame::sourceID): (WebCore::JavaScriptCallFrame::position): (WebCore::JavaScriptCallFrame::line): (WebCore::JavaScriptCallFrame::column): (WebCore::JavaScriptCallFrame::functionName): (WebCore::JavaScriptCallFrame::type): (WebCore::JavaScriptCallFrame::scopeChain): (WebCore::JavaScriptCallFrame::dynamicGlobalObject): (WebCore::JavaScriptCallFrame::thisValue): (WebCore::JavaScriptCallFrame::evaluate): * bindings/js/ScriptDebugServer.cpp: (WebCore::DebuggerCallFrameScope::DebuggerCallFrameScope): (WebCore::DebuggerCallFrameScope::~DebuggerCallFrameScope): (WebCore::ScriptDebugServer::ScriptDebugServer): (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): (WebCore::ScriptDebugServer::evaluateBreakpointAction): (WebCore::ScriptDebugServer::breakProgram): (WebCore::ScriptDebugServer::stepOverStatement): (WebCore::ScriptDebugServer::stepOutOfFunction): (WebCore::ScriptDebugServer::currentDebuggerCallFrame): (WebCore::ScriptDebugServer::dispatchDidPause): (WebCore::ScriptDebugServer::updateCallFrame): (WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded): (WebCore::ScriptDebugServer::pauseIfNeeded): (WebCore::ScriptDebugServer::callEvent): (WebCore::ScriptDebugServer::returnEvent): (WebCore::ScriptDebugServer::willExecuteProgram): (WebCore::ScriptDebugServer::didExecuteProgram): * bindings/js/ScriptDebugServer.h: * bindings/js/WorkerScriptDebugServer.cpp: (WebCore::WorkerScriptDebugServer::willExecuteProgram): Source/WebKit/mac: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFramePrivate dealloc]): (-[WebScriptCallFrame _initWithGlobalObject:functionName:exceptionValue:JSC::]): (-[WebScriptCallFrame functionName]): (-[WebScriptCallFrame exception]): * WebView/WebScriptDebugger.mm: (WebScriptDebugger::exception): LayoutTests: * http/tests/inspector/debugger-test.js: (initialize_DebuggerTest): * inspector-protocol/debugger/call-frame-function-name-expected.txt: Added. * inspector-protocol/debugger/call-frame-function-name.html: Added. * inspector-protocol/debugger/call-frame-this-host-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-host.html: Added. * inspector-protocol/debugger/call-frame-this-nonstrict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-nonstrict.html: Added. * inspector-protocol/debugger/call-frame-this-strict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-strict.html: Added. * inspector/debugger/pause-in-internal-script-expected.txt: Canonical link: https://commits.webkit.org/140413@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-05 00:51:31 +00:00
var scriptIdentifier = messageObject.params.scriptId;
var lineNumber = messageObject.params.startLine + 3;
var columnNumber = 4;
var location = {scriptId: scriptIdentifier, lineNumber: lineNumber, columnNumber: columnNumber};
Web Inspector: use different namespaces in test fixtures for protocol tests and frontend tests https://bugs.webkit.org/show_bug.cgi?id=147787 Patch by Brian Burg <bburg@apple.com> on 2015-08-11 Reviewed by Timothy Hatcher. Refactor test methods to use three distinct namespaces to reflect their implementation: - InspectorProtocol contains commands that are only used from within protocol tests. This includes sending and receiving protocol messages and checking message errors. - InspectorTest contains test methods for full inspector frontend tests. - ProtocolTest contains test methods for protocol tests. In a subsequent patch, most methods in InspectorTest and ProtocolTest namespaces will be unified so that implementations of log, assert, etc. are no longer duplicated. For now, at least make it obvious at each callsite what code is being invoked. * http/tests/inspector/console/access-inspected-object.html: * http/tests/inspector/dom/resources/InspectorDOMListener.js: * http/tests/inspector/page/loading-iframe-document-node.html: * http/tests/inspector/resources/ProtocolTestStub.js: * http/tests/inspector/resources/console-test.js: * http/tests/inspector/resources/probe-test.js: * inspector/console/console-message.html: * inspector/console/css-source-locations.html: * inspector/console/js-source-locations.html: * inspector/console/x-frame-options-message.html: * inspector/css/getSupportedCSSProperties.html: * inspector/debugger/breakpoint-action-detach.html: * inspector/debugger/breakpoint-action-with-exception.html: * inspector/debugger/breakpoint-condition-detach.html: * inspector/debugger/breakpoint-condition-with-bad-script.html: * inspector/debugger/breakpoint-condition-with-exception.html: * inspector/debugger/breakpoint-eval-with-exception.html: * inspector/debugger/breakpoint-inside-conditons-and-actions.html: * inspector/debugger/call-frame-function-name.html: * inspector/debugger/call-frame-this-host.html: * inspector/debugger/call-frame-this-nonstrict.html: * inspector/debugger/call-frame-this-strict.html: * inspector/debugger/debugger-statement.html: * inspector/debugger/didSampleProbe-multiple-probes.html: * inspector/debugger/hit-breakpoint-from-console.html: * inspector/debugger/nested-inspectors.html: * inspector/debugger/pause-dedicated-worker.html: * inspector/debugger/pause-on-assert.html: * inspector/debugger/regress-133182.html: * inspector/debugger/removeBreakpoint.html: * inspector/debugger/searchInContent-linebreaks.html: * inspector/debugger/setBreakpoint-actions.html: * inspector/debugger/setBreakpoint-autoContinue.html: * inspector/debugger/setBreakpoint-column.html: * inspector/debugger/setBreakpoint-condition.html: * inspector/debugger/setBreakpoint-dfg-and-modify-local.html: * inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html: * inspector/debugger/setBreakpoint-dfg.html: * inspector/debugger/setBreakpoint-options-exception.html: * inspector/debugger/setBreakpoint.html: * inspector/debugger/setBreakpointByUrl-sourceURL.html: * inspector/debugger/setPauseOnExceptions-all.html: * inspector/debugger/setPauseOnExceptions-none.html: * inspector/debugger/setPauseOnExceptions-uncaught.html: * inspector/debugger/setVariableValue.html: * inspector/debugger/terminate-dedicated-worker-while-paused.html: * inspector/dom-debugger/node-removed.html: * inspector/dom/dom-remove-events.html: * inspector/dom/dom-search-crash.html: * inspector/dom/dom-search-with-context.html: * inspector/dom/dom-search.html: * inspector/dom/focus.html: * inspector/dom/getAccessibilityPropertiesForNode.html: * inspector/dom/getAccessibilityPropertiesForNode_liveRegion.html: * inspector/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html: * inspector/dom/highlight-flow-with-no-region.html: * inspector/dom/remove-multiple-nodes.html: * inspector/dom/request-child-nodes-depth.html: * inspector/layers/layers-anonymous.html: * inspector/layers/layers-blending-compositing-reasons.html: * inspector/layers/layers-compositing-reasons.html: * inspector/layers/layers-for-node.html: * inspector/layers/layers-generated-content.html: * inspector/layers/layers-reflected-content.html: * inspector/page/archive.html: * inspector/page/frameScheduledNavigation.html: * inspector/page/frameStartedLoading.html: * inspector/page/javascriptDialogEvents.html: * inspector/page/setEmulatedMedia.html: * inspector/runtime/getProperties.html: * inspector/unit-tests/async-test-suite.html: * inspector/unit-tests/sync-test-suite.html: Canonical link: https://commits.webkit.org/165990@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-08-11 18:28:31 +00:00
InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location}, function() {
ProtocolTest.log("Running testFunction");
InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "testFunction()"});
Change ScriptDebugServer to use DebuggerCallFrame instead of JavaScriptCallFrame. https://bugs.webkit.org/show_bug.cgi?id=121969. Reviewed by Geoffrey Garen. Source/JavaScriptCore: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * debugger/Debugger.cpp: * debugger/Debugger.h: * debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::DebuggerCallFrame): (JSC::DebuggerCallFrame::callerFrame): (JSC::DebuggerCallFrame::dynamicGlobalObject): (JSC::DebuggerCallFrame::sourceId): (JSC::DebuggerCallFrame::functionName): (JSC::DebuggerCallFrame::scope): (JSC::DebuggerCallFrame::type): (JSC::DebuggerCallFrame::thisValue): (JSC::DebuggerCallFrame::evaluate): (JSC::DebuggerCallFrame::evaluateWithCallFrame): (JSC::DebuggerCallFrame::invalidate): (JSC::DebuggerCallFrame::positionForCallFrame): (JSC::DebuggerCallFrame::sourceIdForCallFrame): (JSC::DebuggerCallFrame::thisValueForCallFrame): * debugger/DebuggerCallFrame.h: (JSC::DebuggerCallFrame::create): (JSC::DebuggerCallFrame::exec): (JSC::DebuggerCallFrame::line): (JSC::DebuggerCallFrame::column): (JSC::DebuggerCallFrame::position): (JSC::DebuggerCallFrame::isValid): * interpreter/StackVisitor.cpp: Source/WebCore: Tests: inspector-protocol/debugger/call-frame-function-name.html inspector-protocol/debugger/call-frame-this-host.html inspector-protocol/debugger/call-frame-this-nonstrict.html inspector-protocol/debugger/call-frame-this-strict.html 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::thisObject): * bindings/js/JavaScriptCallFrame.cpp: (WebCore::JavaScriptCallFrame::JavaScriptCallFrame): (WebCore::JavaScriptCallFrame::caller): * bindings/js/JavaScriptCallFrame.h: (WebCore::JavaScriptCallFrame::create): (WebCore::JavaScriptCallFrame::sourceID): (WebCore::JavaScriptCallFrame::position): (WebCore::JavaScriptCallFrame::line): (WebCore::JavaScriptCallFrame::column): (WebCore::JavaScriptCallFrame::functionName): (WebCore::JavaScriptCallFrame::type): (WebCore::JavaScriptCallFrame::scopeChain): (WebCore::JavaScriptCallFrame::dynamicGlobalObject): (WebCore::JavaScriptCallFrame::thisValue): (WebCore::JavaScriptCallFrame::evaluate): * bindings/js/ScriptDebugServer.cpp: (WebCore::DebuggerCallFrameScope::DebuggerCallFrameScope): (WebCore::DebuggerCallFrameScope::~DebuggerCallFrameScope): (WebCore::ScriptDebugServer::ScriptDebugServer): (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): (WebCore::ScriptDebugServer::evaluateBreakpointAction): (WebCore::ScriptDebugServer::breakProgram): (WebCore::ScriptDebugServer::stepOverStatement): (WebCore::ScriptDebugServer::stepOutOfFunction): (WebCore::ScriptDebugServer::currentDebuggerCallFrame): (WebCore::ScriptDebugServer::dispatchDidPause): (WebCore::ScriptDebugServer::updateCallFrame): (WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded): (WebCore::ScriptDebugServer::pauseIfNeeded): (WebCore::ScriptDebugServer::callEvent): (WebCore::ScriptDebugServer::returnEvent): (WebCore::ScriptDebugServer::willExecuteProgram): (WebCore::ScriptDebugServer::didExecuteProgram): * bindings/js/ScriptDebugServer.h: * bindings/js/WorkerScriptDebugServer.cpp: (WebCore::WorkerScriptDebugServer::willExecuteProgram): Source/WebKit/mac: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFramePrivate dealloc]): (-[WebScriptCallFrame _initWithGlobalObject:functionName:exceptionValue:JSC::]): (-[WebScriptCallFrame functionName]): (-[WebScriptCallFrame exception]): * WebView/WebScriptDebugger.mm: (WebScriptDebugger::exception): LayoutTests: * http/tests/inspector/debugger-test.js: (initialize_DebuggerTest): * inspector-protocol/debugger/call-frame-function-name-expected.txt: Added. * inspector-protocol/debugger/call-frame-function-name.html: Added. * inspector-protocol/debugger/call-frame-this-host-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-host.html: Added. * inspector-protocol/debugger/call-frame-this-nonstrict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-nonstrict.html: Added. * inspector-protocol/debugger/call-frame-this-strict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-strict.html: Added. * inspector/debugger/pause-in-internal-script-expected.txt: Canonical link: https://commits.webkit.org/140413@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-05 00:51:31 +00:00
});
}
}
var step = 0;
Web Inspector: use different namespaces in test fixtures for protocol tests and frontend tests https://bugs.webkit.org/show_bug.cgi?id=147787 Patch by Brian Burg <bburg@apple.com> on 2015-08-11 Reviewed by Timothy Hatcher. Refactor test methods to use three distinct namespaces to reflect their implementation: - InspectorProtocol contains commands that are only used from within protocol tests. This includes sending and receiving protocol messages and checking message errors. - InspectorTest contains test methods for full inspector frontend tests. - ProtocolTest contains test methods for protocol tests. In a subsequent patch, most methods in InspectorTest and ProtocolTest namespaces will be unified so that implementations of log, assert, etc. are no longer duplicated. For now, at least make it obvious at each callsite what code is being invoked. * http/tests/inspector/console/access-inspected-object.html: * http/tests/inspector/dom/resources/InspectorDOMListener.js: * http/tests/inspector/page/loading-iframe-document-node.html: * http/tests/inspector/resources/ProtocolTestStub.js: * http/tests/inspector/resources/console-test.js: * http/tests/inspector/resources/probe-test.js: * inspector/console/console-message.html: * inspector/console/css-source-locations.html: * inspector/console/js-source-locations.html: * inspector/console/x-frame-options-message.html: * inspector/css/getSupportedCSSProperties.html: * inspector/debugger/breakpoint-action-detach.html: * inspector/debugger/breakpoint-action-with-exception.html: * inspector/debugger/breakpoint-condition-detach.html: * inspector/debugger/breakpoint-condition-with-bad-script.html: * inspector/debugger/breakpoint-condition-with-exception.html: * inspector/debugger/breakpoint-eval-with-exception.html: * inspector/debugger/breakpoint-inside-conditons-and-actions.html: * inspector/debugger/call-frame-function-name.html: * inspector/debugger/call-frame-this-host.html: * inspector/debugger/call-frame-this-nonstrict.html: * inspector/debugger/call-frame-this-strict.html: * inspector/debugger/debugger-statement.html: * inspector/debugger/didSampleProbe-multiple-probes.html: * inspector/debugger/hit-breakpoint-from-console.html: * inspector/debugger/nested-inspectors.html: * inspector/debugger/pause-dedicated-worker.html: * inspector/debugger/pause-on-assert.html: * inspector/debugger/regress-133182.html: * inspector/debugger/removeBreakpoint.html: * inspector/debugger/searchInContent-linebreaks.html: * inspector/debugger/setBreakpoint-actions.html: * inspector/debugger/setBreakpoint-autoContinue.html: * inspector/debugger/setBreakpoint-column.html: * inspector/debugger/setBreakpoint-condition.html: * inspector/debugger/setBreakpoint-dfg-and-modify-local.html: * inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html: * inspector/debugger/setBreakpoint-dfg.html: * inspector/debugger/setBreakpoint-options-exception.html: * inspector/debugger/setBreakpoint.html: * inspector/debugger/setBreakpointByUrl-sourceURL.html: * inspector/debugger/setPauseOnExceptions-all.html: * inspector/debugger/setPauseOnExceptions-none.html: * inspector/debugger/setPauseOnExceptions-uncaught.html: * inspector/debugger/setVariableValue.html: * inspector/debugger/terminate-dedicated-worker-while-paused.html: * inspector/dom-debugger/node-removed.html: * inspector/dom/dom-remove-events.html: * inspector/dom/dom-search-crash.html: * inspector/dom/dom-search-with-context.html: * inspector/dom/dom-search.html: * inspector/dom/focus.html: * inspector/dom/getAccessibilityPropertiesForNode.html: * inspector/dom/getAccessibilityPropertiesForNode_liveRegion.html: * inspector/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html: * inspector/dom/highlight-flow-with-no-region.html: * inspector/dom/remove-multiple-nodes.html: * inspector/dom/request-child-nodes-depth.html: * inspector/layers/layers-anonymous.html: * inspector/layers/layers-blending-compositing-reasons.html: * inspector/layers/layers-compositing-reasons.html: * inspector/layers/layers-for-node.html: * inspector/layers/layers-generated-content.html: * inspector/layers/layers-reflected-content.html: * inspector/page/archive.html: * inspector/page/frameScheduledNavigation.html: * inspector/page/frameStartedLoading.html: * inspector/page/javascriptDialogEvents.html: * inspector/page/setEmulatedMedia.html: * inspector/runtime/getProperties.html: * inspector/unit-tests/async-test-suite.html: * inspector/unit-tests/sync-test-suite.html: Canonical link: https://commits.webkit.org/165990@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-08-11 18:28:31 +00:00
InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
Change ScriptDebugServer to use DebuggerCallFrame instead of JavaScriptCallFrame. https://bugs.webkit.org/show_bug.cgi?id=121969. Reviewed by Geoffrey Garen. Source/JavaScriptCore: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * debugger/Debugger.cpp: * debugger/Debugger.h: * debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::DebuggerCallFrame): (JSC::DebuggerCallFrame::callerFrame): (JSC::DebuggerCallFrame::dynamicGlobalObject): (JSC::DebuggerCallFrame::sourceId): (JSC::DebuggerCallFrame::functionName): (JSC::DebuggerCallFrame::scope): (JSC::DebuggerCallFrame::type): (JSC::DebuggerCallFrame::thisValue): (JSC::DebuggerCallFrame::evaluate): (JSC::DebuggerCallFrame::evaluateWithCallFrame): (JSC::DebuggerCallFrame::invalidate): (JSC::DebuggerCallFrame::positionForCallFrame): (JSC::DebuggerCallFrame::sourceIdForCallFrame): (JSC::DebuggerCallFrame::thisValueForCallFrame): * debugger/DebuggerCallFrame.h: (JSC::DebuggerCallFrame::create): (JSC::DebuggerCallFrame::exec): (JSC::DebuggerCallFrame::line): (JSC::DebuggerCallFrame::column): (JSC::DebuggerCallFrame::position): (JSC::DebuggerCallFrame::isValid): * interpreter/StackVisitor.cpp: Source/WebCore: Tests: inspector-protocol/debugger/call-frame-function-name.html inspector-protocol/debugger/call-frame-this-host.html inspector-protocol/debugger/call-frame-this-nonstrict.html inspector-protocol/debugger/call-frame-this-strict.html 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::thisObject): * bindings/js/JavaScriptCallFrame.cpp: (WebCore::JavaScriptCallFrame::JavaScriptCallFrame): (WebCore::JavaScriptCallFrame::caller): * bindings/js/JavaScriptCallFrame.h: (WebCore::JavaScriptCallFrame::create): (WebCore::JavaScriptCallFrame::sourceID): (WebCore::JavaScriptCallFrame::position): (WebCore::JavaScriptCallFrame::line): (WebCore::JavaScriptCallFrame::column): (WebCore::JavaScriptCallFrame::functionName): (WebCore::JavaScriptCallFrame::type): (WebCore::JavaScriptCallFrame::scopeChain): (WebCore::JavaScriptCallFrame::dynamicGlobalObject): (WebCore::JavaScriptCallFrame::thisValue): (WebCore::JavaScriptCallFrame::evaluate): * bindings/js/ScriptDebugServer.cpp: (WebCore::DebuggerCallFrameScope::DebuggerCallFrameScope): (WebCore::DebuggerCallFrameScope::~DebuggerCallFrameScope): (WebCore::ScriptDebugServer::ScriptDebugServer): (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): (WebCore::ScriptDebugServer::evaluateBreakpointAction): (WebCore::ScriptDebugServer::breakProgram): (WebCore::ScriptDebugServer::stepOverStatement): (WebCore::ScriptDebugServer::stepOutOfFunction): (WebCore::ScriptDebugServer::currentDebuggerCallFrame): (WebCore::ScriptDebugServer::dispatchDidPause): (WebCore::ScriptDebugServer::updateCallFrame): (WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded): (WebCore::ScriptDebugServer::pauseIfNeeded): (WebCore::ScriptDebugServer::callEvent): (WebCore::ScriptDebugServer::returnEvent): (WebCore::ScriptDebugServer::willExecuteProgram): (WebCore::ScriptDebugServer::didExecuteProgram): * bindings/js/ScriptDebugServer.h: * bindings/js/WorkerScriptDebugServer.cpp: (WebCore::WorkerScriptDebugServer::willExecuteProgram): Source/WebKit/mac: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFramePrivate dealloc]): (-[WebScriptCallFrame _initWithGlobalObject:functionName:exceptionValue:JSC::]): (-[WebScriptCallFrame functionName]): (-[WebScriptCallFrame exception]): * WebView/WebScriptDebugger.mm: (WebScriptDebugger::exception): LayoutTests: * http/tests/inspector/debugger-test.js: (initialize_DebuggerTest): * inspector-protocol/debugger/call-frame-function-name-expected.txt: Added. * inspector-protocol/debugger/call-frame-function-name.html: Added. * inspector-protocol/debugger/call-frame-this-host-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-host.html: Added. * inspector-protocol/debugger/call-frame-this-nonstrict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-nonstrict.html: Added. * inspector-protocol/debugger/call-frame-this-strict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-strict.html: Added. * inspector/debugger/pause-in-internal-script-expected.txt: Canonical link: https://commits.webkit.org/140413@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-05 00:51:31 +00:00
{
function assertThisValue(step, actual, expected) {
var success = true;
if (actual.type != expected.type) {
Web Inspector: use different namespaces in test fixtures for protocol tests and frontend tests https://bugs.webkit.org/show_bug.cgi?id=147787 Patch by Brian Burg <bburg@apple.com> on 2015-08-11 Reviewed by Timothy Hatcher. Refactor test methods to use three distinct namespaces to reflect their implementation: - InspectorProtocol contains commands that are only used from within protocol tests. This includes sending and receiving protocol messages and checking message errors. - InspectorTest contains test methods for full inspector frontend tests. - ProtocolTest contains test methods for protocol tests. In a subsequent patch, most methods in InspectorTest and ProtocolTest namespaces will be unified so that implementations of log, assert, etc. are no longer duplicated. For now, at least make it obvious at each callsite what code is being invoked. * http/tests/inspector/console/access-inspected-object.html: * http/tests/inspector/dom/resources/InspectorDOMListener.js: * http/tests/inspector/page/loading-iframe-document-node.html: * http/tests/inspector/resources/ProtocolTestStub.js: * http/tests/inspector/resources/console-test.js: * http/tests/inspector/resources/probe-test.js: * inspector/console/console-message.html: * inspector/console/css-source-locations.html: * inspector/console/js-source-locations.html: * inspector/console/x-frame-options-message.html: * inspector/css/getSupportedCSSProperties.html: * inspector/debugger/breakpoint-action-detach.html: * inspector/debugger/breakpoint-action-with-exception.html: * inspector/debugger/breakpoint-condition-detach.html: * inspector/debugger/breakpoint-condition-with-bad-script.html: * inspector/debugger/breakpoint-condition-with-exception.html: * inspector/debugger/breakpoint-eval-with-exception.html: * inspector/debugger/breakpoint-inside-conditons-and-actions.html: * inspector/debugger/call-frame-function-name.html: * inspector/debugger/call-frame-this-host.html: * inspector/debugger/call-frame-this-nonstrict.html: * inspector/debugger/call-frame-this-strict.html: * inspector/debugger/debugger-statement.html: * inspector/debugger/didSampleProbe-multiple-probes.html: * inspector/debugger/hit-breakpoint-from-console.html: * inspector/debugger/nested-inspectors.html: * inspector/debugger/pause-dedicated-worker.html: * inspector/debugger/pause-on-assert.html: * inspector/debugger/regress-133182.html: * inspector/debugger/removeBreakpoint.html: * inspector/debugger/searchInContent-linebreaks.html: * inspector/debugger/setBreakpoint-actions.html: * inspector/debugger/setBreakpoint-autoContinue.html: * inspector/debugger/setBreakpoint-column.html: * inspector/debugger/setBreakpoint-condition.html: * inspector/debugger/setBreakpoint-dfg-and-modify-local.html: * inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html: * inspector/debugger/setBreakpoint-dfg.html: * inspector/debugger/setBreakpoint-options-exception.html: * inspector/debugger/setBreakpoint.html: * inspector/debugger/setBreakpointByUrl-sourceURL.html: * inspector/debugger/setPauseOnExceptions-all.html: * inspector/debugger/setPauseOnExceptions-none.html: * inspector/debugger/setPauseOnExceptions-uncaught.html: * inspector/debugger/setVariableValue.html: * inspector/debugger/terminate-dedicated-worker-while-paused.html: * inspector/dom-debugger/node-removed.html: * inspector/dom/dom-remove-events.html: * inspector/dom/dom-search-crash.html: * inspector/dom/dom-search-with-context.html: * inspector/dom/dom-search.html: * inspector/dom/focus.html: * inspector/dom/getAccessibilityPropertiesForNode.html: * inspector/dom/getAccessibilityPropertiesForNode_liveRegion.html: * inspector/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html: * inspector/dom/highlight-flow-with-no-region.html: * inspector/dom/remove-multiple-nodes.html: * inspector/dom/request-child-nodes-depth.html: * inspector/layers/layers-anonymous.html: * inspector/layers/layers-blending-compositing-reasons.html: * inspector/layers/layers-compositing-reasons.html: * inspector/layers/layers-for-node.html: * inspector/layers/layers-generated-content.html: * inspector/layers/layers-reflected-content.html: * inspector/page/archive.html: * inspector/page/frameScheduledNavigation.html: * inspector/page/frameStartedLoading.html: * inspector/page/javascriptDialogEvents.html: * inspector/page/setEmulatedMedia.html: * inspector/runtime/getProperties.html: * inspector/unit-tests/async-test-suite.html: * inspector/unit-tests/sync-test-suite.html: Canonical link: https://commits.webkit.org/165990@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-08-11 18:28:31 +00:00
ProtocolTest.log('FAIL: step ' + step + ': expect type "' + expected.type + '", actual "' + actual.type + '"');
Change ScriptDebugServer to use DebuggerCallFrame instead of JavaScriptCallFrame. https://bugs.webkit.org/show_bug.cgi?id=121969. Reviewed by Geoffrey Garen. Source/JavaScriptCore: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * debugger/Debugger.cpp: * debugger/Debugger.h: * debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::DebuggerCallFrame): (JSC::DebuggerCallFrame::callerFrame): (JSC::DebuggerCallFrame::dynamicGlobalObject): (JSC::DebuggerCallFrame::sourceId): (JSC::DebuggerCallFrame::functionName): (JSC::DebuggerCallFrame::scope): (JSC::DebuggerCallFrame::type): (JSC::DebuggerCallFrame::thisValue): (JSC::DebuggerCallFrame::evaluate): (JSC::DebuggerCallFrame::evaluateWithCallFrame): (JSC::DebuggerCallFrame::invalidate): (JSC::DebuggerCallFrame::positionForCallFrame): (JSC::DebuggerCallFrame::sourceIdForCallFrame): (JSC::DebuggerCallFrame::thisValueForCallFrame): * debugger/DebuggerCallFrame.h: (JSC::DebuggerCallFrame::create): (JSC::DebuggerCallFrame::exec): (JSC::DebuggerCallFrame::line): (JSC::DebuggerCallFrame::column): (JSC::DebuggerCallFrame::position): (JSC::DebuggerCallFrame::isValid): * interpreter/StackVisitor.cpp: Source/WebCore: Tests: inspector-protocol/debugger/call-frame-function-name.html inspector-protocol/debugger/call-frame-this-host.html inspector-protocol/debugger/call-frame-this-nonstrict.html inspector-protocol/debugger/call-frame-this-strict.html 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::thisObject): * bindings/js/JavaScriptCallFrame.cpp: (WebCore::JavaScriptCallFrame::JavaScriptCallFrame): (WebCore::JavaScriptCallFrame::caller): * bindings/js/JavaScriptCallFrame.h: (WebCore::JavaScriptCallFrame::create): (WebCore::JavaScriptCallFrame::sourceID): (WebCore::JavaScriptCallFrame::position): (WebCore::JavaScriptCallFrame::line): (WebCore::JavaScriptCallFrame::column): (WebCore::JavaScriptCallFrame::functionName): (WebCore::JavaScriptCallFrame::type): (WebCore::JavaScriptCallFrame::scopeChain): (WebCore::JavaScriptCallFrame::dynamicGlobalObject): (WebCore::JavaScriptCallFrame::thisValue): (WebCore::JavaScriptCallFrame::evaluate): * bindings/js/ScriptDebugServer.cpp: (WebCore::DebuggerCallFrameScope::DebuggerCallFrameScope): (WebCore::DebuggerCallFrameScope::~DebuggerCallFrameScope): (WebCore::ScriptDebugServer::ScriptDebugServer): (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): (WebCore::ScriptDebugServer::evaluateBreakpointAction): (WebCore::ScriptDebugServer::breakProgram): (WebCore::ScriptDebugServer::stepOverStatement): (WebCore::ScriptDebugServer::stepOutOfFunction): (WebCore::ScriptDebugServer::currentDebuggerCallFrame): (WebCore::ScriptDebugServer::dispatchDidPause): (WebCore::ScriptDebugServer::updateCallFrame): (WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded): (WebCore::ScriptDebugServer::pauseIfNeeded): (WebCore::ScriptDebugServer::callEvent): (WebCore::ScriptDebugServer::returnEvent): (WebCore::ScriptDebugServer::willExecuteProgram): (WebCore::ScriptDebugServer::didExecuteProgram): * bindings/js/ScriptDebugServer.h: * bindings/js/WorkerScriptDebugServer.cpp: (WebCore::WorkerScriptDebugServer::willExecuteProgram): Source/WebKit/mac: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFramePrivate dealloc]): (-[WebScriptCallFrame _initWithGlobalObject:functionName:exceptionValue:JSC::]): (-[WebScriptCallFrame functionName]): (-[WebScriptCallFrame exception]): * WebView/WebScriptDebugger.mm: (WebScriptDebugger::exception): LayoutTests: * http/tests/inspector/debugger-test.js: (initialize_DebuggerTest): * inspector-protocol/debugger/call-frame-function-name-expected.txt: Added. * inspector-protocol/debugger/call-frame-function-name.html: Added. * inspector-protocol/debugger/call-frame-this-host-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-host.html: Added. * inspector-protocol/debugger/call-frame-this-nonstrict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-nonstrict.html: Added. * inspector-protocol/debugger/call-frame-this-strict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-strict.html: Added. * inspector/debugger/pause-in-internal-script-expected.txt: Canonical link: https://commits.webkit.org/140413@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-05 00:51:31 +00:00
success = false;
}
if (actual.className != expected.className) {
var actualResult
Web Inspector: use different namespaces in test fixtures for protocol tests and frontend tests https://bugs.webkit.org/show_bug.cgi?id=147787 Patch by Brian Burg <bburg@apple.com> on 2015-08-11 Reviewed by Timothy Hatcher. Refactor test methods to use three distinct namespaces to reflect their implementation: - InspectorProtocol contains commands that are only used from within protocol tests. This includes sending and receiving protocol messages and checking message errors. - InspectorTest contains test methods for full inspector frontend tests. - ProtocolTest contains test methods for protocol tests. In a subsequent patch, most methods in InspectorTest and ProtocolTest namespaces will be unified so that implementations of log, assert, etc. are no longer duplicated. For now, at least make it obvious at each callsite what code is being invoked. * http/tests/inspector/console/access-inspected-object.html: * http/tests/inspector/dom/resources/InspectorDOMListener.js: * http/tests/inspector/page/loading-iframe-document-node.html: * http/tests/inspector/resources/ProtocolTestStub.js: * http/tests/inspector/resources/console-test.js: * http/tests/inspector/resources/probe-test.js: * inspector/console/console-message.html: * inspector/console/css-source-locations.html: * inspector/console/js-source-locations.html: * inspector/console/x-frame-options-message.html: * inspector/css/getSupportedCSSProperties.html: * inspector/debugger/breakpoint-action-detach.html: * inspector/debugger/breakpoint-action-with-exception.html: * inspector/debugger/breakpoint-condition-detach.html: * inspector/debugger/breakpoint-condition-with-bad-script.html: * inspector/debugger/breakpoint-condition-with-exception.html: * inspector/debugger/breakpoint-eval-with-exception.html: * inspector/debugger/breakpoint-inside-conditons-and-actions.html: * inspector/debugger/call-frame-function-name.html: * inspector/debugger/call-frame-this-host.html: * inspector/debugger/call-frame-this-nonstrict.html: * inspector/debugger/call-frame-this-strict.html: * inspector/debugger/debugger-statement.html: * inspector/debugger/didSampleProbe-multiple-probes.html: * inspector/debugger/hit-breakpoint-from-console.html: * inspector/debugger/nested-inspectors.html: * inspector/debugger/pause-dedicated-worker.html: * inspector/debugger/pause-on-assert.html: * inspector/debugger/regress-133182.html: * inspector/debugger/removeBreakpoint.html: * inspector/debugger/searchInContent-linebreaks.html: * inspector/debugger/setBreakpoint-actions.html: * inspector/debugger/setBreakpoint-autoContinue.html: * inspector/debugger/setBreakpoint-column.html: * inspector/debugger/setBreakpoint-condition.html: * inspector/debugger/setBreakpoint-dfg-and-modify-local.html: * inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html: * inspector/debugger/setBreakpoint-dfg.html: * inspector/debugger/setBreakpoint-options-exception.html: * inspector/debugger/setBreakpoint.html: * inspector/debugger/setBreakpointByUrl-sourceURL.html: * inspector/debugger/setPauseOnExceptions-all.html: * inspector/debugger/setPauseOnExceptions-none.html: * inspector/debugger/setPauseOnExceptions-uncaught.html: * inspector/debugger/setVariableValue.html: * inspector/debugger/terminate-dedicated-worker-while-paused.html: * inspector/dom-debugger/node-removed.html: * inspector/dom/dom-remove-events.html: * inspector/dom/dom-search-crash.html: * inspector/dom/dom-search-with-context.html: * inspector/dom/dom-search.html: * inspector/dom/focus.html: * inspector/dom/getAccessibilityPropertiesForNode.html: * inspector/dom/getAccessibilityPropertiesForNode_liveRegion.html: * inspector/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html: * inspector/dom/highlight-flow-with-no-region.html: * inspector/dom/remove-multiple-nodes.html: * inspector/dom/request-child-nodes-depth.html: * inspector/layers/layers-anonymous.html: * inspector/layers/layers-blending-compositing-reasons.html: * inspector/layers/layers-compositing-reasons.html: * inspector/layers/layers-for-node.html: * inspector/layers/layers-generated-content.html: * inspector/layers/layers-reflected-content.html: * inspector/page/archive.html: * inspector/page/frameScheduledNavigation.html: * inspector/page/frameStartedLoading.html: * inspector/page/javascriptDialogEvents.html: * inspector/page/setEmulatedMedia.html: * inspector/runtime/getProperties.html: * inspector/unit-tests/async-test-suite.html: * inspector/unit-tests/sync-test-suite.html: Canonical link: https://commits.webkit.org/165990@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-08-11 18:28:31 +00:00
ProtocolTest.log('FAIL: step ' + step + ': expect className "' + expected.className + '", actual "' + actual.className + '"');
Change ScriptDebugServer to use DebuggerCallFrame instead of JavaScriptCallFrame. https://bugs.webkit.org/show_bug.cgi?id=121969. Reviewed by Geoffrey Garen. Source/JavaScriptCore: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * debugger/Debugger.cpp: * debugger/Debugger.h: * debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::DebuggerCallFrame): (JSC::DebuggerCallFrame::callerFrame): (JSC::DebuggerCallFrame::dynamicGlobalObject): (JSC::DebuggerCallFrame::sourceId): (JSC::DebuggerCallFrame::functionName): (JSC::DebuggerCallFrame::scope): (JSC::DebuggerCallFrame::type): (JSC::DebuggerCallFrame::thisValue): (JSC::DebuggerCallFrame::evaluate): (JSC::DebuggerCallFrame::evaluateWithCallFrame): (JSC::DebuggerCallFrame::invalidate): (JSC::DebuggerCallFrame::positionForCallFrame): (JSC::DebuggerCallFrame::sourceIdForCallFrame): (JSC::DebuggerCallFrame::thisValueForCallFrame): * debugger/DebuggerCallFrame.h: (JSC::DebuggerCallFrame::create): (JSC::DebuggerCallFrame::exec): (JSC::DebuggerCallFrame::line): (JSC::DebuggerCallFrame::column): (JSC::DebuggerCallFrame::position): (JSC::DebuggerCallFrame::isValid): * interpreter/StackVisitor.cpp: Source/WebCore: Tests: inspector-protocol/debugger/call-frame-function-name.html inspector-protocol/debugger/call-frame-this-host.html inspector-protocol/debugger/call-frame-this-nonstrict.html inspector-protocol/debugger/call-frame-this-strict.html 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::thisObject): * bindings/js/JavaScriptCallFrame.cpp: (WebCore::JavaScriptCallFrame::JavaScriptCallFrame): (WebCore::JavaScriptCallFrame::caller): * bindings/js/JavaScriptCallFrame.h: (WebCore::JavaScriptCallFrame::create): (WebCore::JavaScriptCallFrame::sourceID): (WebCore::JavaScriptCallFrame::position): (WebCore::JavaScriptCallFrame::line): (WebCore::JavaScriptCallFrame::column): (WebCore::JavaScriptCallFrame::functionName): (WebCore::JavaScriptCallFrame::type): (WebCore::JavaScriptCallFrame::scopeChain): (WebCore::JavaScriptCallFrame::dynamicGlobalObject): (WebCore::JavaScriptCallFrame::thisValue): (WebCore::JavaScriptCallFrame::evaluate): * bindings/js/ScriptDebugServer.cpp: (WebCore::DebuggerCallFrameScope::DebuggerCallFrameScope): (WebCore::DebuggerCallFrameScope::~DebuggerCallFrameScope): (WebCore::ScriptDebugServer::ScriptDebugServer): (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): (WebCore::ScriptDebugServer::evaluateBreakpointAction): (WebCore::ScriptDebugServer::breakProgram): (WebCore::ScriptDebugServer::stepOverStatement): (WebCore::ScriptDebugServer::stepOutOfFunction): (WebCore::ScriptDebugServer::currentDebuggerCallFrame): (WebCore::ScriptDebugServer::dispatchDidPause): (WebCore::ScriptDebugServer::updateCallFrame): (WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded): (WebCore::ScriptDebugServer::pauseIfNeeded): (WebCore::ScriptDebugServer::callEvent): (WebCore::ScriptDebugServer::returnEvent): (WebCore::ScriptDebugServer::willExecuteProgram): (WebCore::ScriptDebugServer::didExecuteProgram): * bindings/js/ScriptDebugServer.h: * bindings/js/WorkerScriptDebugServer.cpp: (WebCore::WorkerScriptDebugServer::willExecuteProgram): Source/WebKit/mac: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFramePrivate dealloc]): (-[WebScriptCallFrame _initWithGlobalObject:functionName:exceptionValue:JSC::]): (-[WebScriptCallFrame functionName]): (-[WebScriptCallFrame exception]): * WebView/WebScriptDebugger.mm: (WebScriptDebugger::exception): LayoutTests: * http/tests/inspector/debugger-test.js: (initialize_DebuggerTest): * inspector-protocol/debugger/call-frame-function-name-expected.txt: Added. * inspector-protocol/debugger/call-frame-function-name.html: Added. * inspector-protocol/debugger/call-frame-this-host-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-host.html: Added. * inspector-protocol/debugger/call-frame-this-nonstrict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-nonstrict.html: Added. * inspector-protocol/debugger/call-frame-this-strict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-strict.html: Added. * inspector/debugger/pause-in-internal-script-expected.txt: Canonical link: https://commits.webkit.org/140413@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-05 00:51:31 +00:00
success = false;
}
if (success)
Web Inspector: use different namespaces in test fixtures for protocol tests and frontend tests https://bugs.webkit.org/show_bug.cgi?id=147787 Patch by Brian Burg <bburg@apple.com> on 2015-08-11 Reviewed by Timothy Hatcher. Refactor test methods to use three distinct namespaces to reflect their implementation: - InspectorProtocol contains commands that are only used from within protocol tests. This includes sending and receiving protocol messages and checking message errors. - InspectorTest contains test methods for full inspector frontend tests. - ProtocolTest contains test methods for protocol tests. In a subsequent patch, most methods in InspectorTest and ProtocolTest namespaces will be unified so that implementations of log, assert, etc. are no longer duplicated. For now, at least make it obvious at each callsite what code is being invoked. * http/tests/inspector/console/access-inspected-object.html: * http/tests/inspector/dom/resources/InspectorDOMListener.js: * http/tests/inspector/page/loading-iframe-document-node.html: * http/tests/inspector/resources/ProtocolTestStub.js: * http/tests/inspector/resources/console-test.js: * http/tests/inspector/resources/probe-test.js: * inspector/console/console-message.html: * inspector/console/css-source-locations.html: * inspector/console/js-source-locations.html: * inspector/console/x-frame-options-message.html: * inspector/css/getSupportedCSSProperties.html: * inspector/debugger/breakpoint-action-detach.html: * inspector/debugger/breakpoint-action-with-exception.html: * inspector/debugger/breakpoint-condition-detach.html: * inspector/debugger/breakpoint-condition-with-bad-script.html: * inspector/debugger/breakpoint-condition-with-exception.html: * inspector/debugger/breakpoint-eval-with-exception.html: * inspector/debugger/breakpoint-inside-conditons-and-actions.html: * inspector/debugger/call-frame-function-name.html: * inspector/debugger/call-frame-this-host.html: * inspector/debugger/call-frame-this-nonstrict.html: * inspector/debugger/call-frame-this-strict.html: * inspector/debugger/debugger-statement.html: * inspector/debugger/didSampleProbe-multiple-probes.html: * inspector/debugger/hit-breakpoint-from-console.html: * inspector/debugger/nested-inspectors.html: * inspector/debugger/pause-dedicated-worker.html: * inspector/debugger/pause-on-assert.html: * inspector/debugger/regress-133182.html: * inspector/debugger/removeBreakpoint.html: * inspector/debugger/searchInContent-linebreaks.html: * inspector/debugger/setBreakpoint-actions.html: * inspector/debugger/setBreakpoint-autoContinue.html: * inspector/debugger/setBreakpoint-column.html: * inspector/debugger/setBreakpoint-condition.html: * inspector/debugger/setBreakpoint-dfg-and-modify-local.html: * inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html: * inspector/debugger/setBreakpoint-dfg.html: * inspector/debugger/setBreakpoint-options-exception.html: * inspector/debugger/setBreakpoint.html: * inspector/debugger/setBreakpointByUrl-sourceURL.html: * inspector/debugger/setPauseOnExceptions-all.html: * inspector/debugger/setPauseOnExceptions-none.html: * inspector/debugger/setPauseOnExceptions-uncaught.html: * inspector/debugger/setVariableValue.html: * inspector/debugger/terminate-dedicated-worker-while-paused.html: * inspector/dom-debugger/node-removed.html: * inspector/dom/dom-remove-events.html: * inspector/dom/dom-search-crash.html: * inspector/dom/dom-search-with-context.html: * inspector/dom/dom-search.html: * inspector/dom/focus.html: * inspector/dom/getAccessibilityPropertiesForNode.html: * inspector/dom/getAccessibilityPropertiesForNode_liveRegion.html: * inspector/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html: * inspector/dom/highlight-flow-with-no-region.html: * inspector/dom/remove-multiple-nodes.html: * inspector/dom/request-child-nodes-depth.html: * inspector/layers/layers-anonymous.html: * inspector/layers/layers-blending-compositing-reasons.html: * inspector/layers/layers-compositing-reasons.html: * inspector/layers/layers-for-node.html: * inspector/layers/layers-generated-content.html: * inspector/layers/layers-reflected-content.html: * inspector/page/archive.html: * inspector/page/frameScheduledNavigation.html: * inspector/page/frameStartedLoading.html: * inspector/page/javascriptDialogEvents.html: * inspector/page/setEmulatedMedia.html: * inspector/runtime/getProperties.html: * inspector/unit-tests/async-test-suite.html: * inspector/unit-tests/sync-test-suite.html: Canonical link: https://commits.webkit.org/165990@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-08-11 18:28:31 +00:00
ProtocolTest.log('PASS: step ' + step + ': type "' + actual.type + '" className "' + actual.className + '"');
Change ScriptDebugServer to use DebuggerCallFrame instead of JavaScriptCallFrame. https://bugs.webkit.org/show_bug.cgi?id=121969. Reviewed by Geoffrey Garen. Source/JavaScriptCore: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * debugger/Debugger.cpp: * debugger/Debugger.h: * debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::DebuggerCallFrame): (JSC::DebuggerCallFrame::callerFrame): (JSC::DebuggerCallFrame::dynamicGlobalObject): (JSC::DebuggerCallFrame::sourceId): (JSC::DebuggerCallFrame::functionName): (JSC::DebuggerCallFrame::scope): (JSC::DebuggerCallFrame::type): (JSC::DebuggerCallFrame::thisValue): (JSC::DebuggerCallFrame::evaluate): (JSC::DebuggerCallFrame::evaluateWithCallFrame): (JSC::DebuggerCallFrame::invalidate): (JSC::DebuggerCallFrame::positionForCallFrame): (JSC::DebuggerCallFrame::sourceIdForCallFrame): (JSC::DebuggerCallFrame::thisValueForCallFrame): * debugger/DebuggerCallFrame.h: (JSC::DebuggerCallFrame::create): (JSC::DebuggerCallFrame::exec): (JSC::DebuggerCallFrame::line): (JSC::DebuggerCallFrame::column): (JSC::DebuggerCallFrame::position): (JSC::DebuggerCallFrame::isValid): * interpreter/StackVisitor.cpp: Source/WebCore: Tests: inspector-protocol/debugger/call-frame-function-name.html inspector-protocol/debugger/call-frame-this-host.html inspector-protocol/debugger/call-frame-this-nonstrict.html inspector-protocol/debugger/call-frame-this-strict.html 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::thisObject): * bindings/js/JavaScriptCallFrame.cpp: (WebCore::JavaScriptCallFrame::JavaScriptCallFrame): (WebCore::JavaScriptCallFrame::caller): * bindings/js/JavaScriptCallFrame.h: (WebCore::JavaScriptCallFrame::create): (WebCore::JavaScriptCallFrame::sourceID): (WebCore::JavaScriptCallFrame::position): (WebCore::JavaScriptCallFrame::line): (WebCore::JavaScriptCallFrame::column): (WebCore::JavaScriptCallFrame::functionName): (WebCore::JavaScriptCallFrame::type): (WebCore::JavaScriptCallFrame::scopeChain): (WebCore::JavaScriptCallFrame::dynamicGlobalObject): (WebCore::JavaScriptCallFrame::thisValue): (WebCore::JavaScriptCallFrame::evaluate): * bindings/js/ScriptDebugServer.cpp: (WebCore::DebuggerCallFrameScope::DebuggerCallFrameScope): (WebCore::DebuggerCallFrameScope::~DebuggerCallFrameScope): (WebCore::ScriptDebugServer::ScriptDebugServer): (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): (WebCore::ScriptDebugServer::evaluateBreakpointAction): (WebCore::ScriptDebugServer::breakProgram): (WebCore::ScriptDebugServer::stepOverStatement): (WebCore::ScriptDebugServer::stepOutOfFunction): (WebCore::ScriptDebugServer::currentDebuggerCallFrame): (WebCore::ScriptDebugServer::dispatchDidPause): (WebCore::ScriptDebugServer::updateCallFrame): (WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded): (WebCore::ScriptDebugServer::pauseIfNeeded): (WebCore::ScriptDebugServer::callEvent): (WebCore::ScriptDebugServer::returnEvent): (WebCore::ScriptDebugServer::willExecuteProgram): (WebCore::ScriptDebugServer::didExecuteProgram): * bindings/js/ScriptDebugServer.h: * bindings/js/WorkerScriptDebugServer.cpp: (WebCore::WorkerScriptDebugServer::willExecuteProgram): Source/WebKit/mac: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFramePrivate dealloc]): (-[WebScriptCallFrame _initWithGlobalObject:functionName:exceptionValue:JSC::]): (-[WebScriptCallFrame functionName]): (-[WebScriptCallFrame exception]): * WebView/WebScriptDebugger.mm: (WebScriptDebugger::exception): LayoutTests: * http/tests/inspector/debugger-test.js: (initialize_DebuggerTest): * inspector-protocol/debugger/call-frame-function-name-expected.txt: Added. * inspector-protocol/debugger/call-frame-function-name.html: Added. * inspector-protocol/debugger/call-frame-this-host-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-host.html: Added. * inspector-protocol/debugger/call-frame-this-nonstrict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-nonstrict.html: Added. * inspector-protocol/debugger/call-frame-this-strict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-strict.html: Added. * inspector/debugger/pause-in-internal-script-expected.txt: Canonical link: https://commits.webkit.org/140413@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-05 00:51:31 +00:00
}
switch (step) {
case 0:
assertThisValue(0, messageObject.params.callFrames[1].this, {
"type": "object",
"className": "Number"
});
break;
case 1:
assertThisValue(1, messageObject.params.callFrames[1].this, {
"type": "object",
"className": "String"
});
break;
case 2:
assertThisValue(2, messageObject.params.callFrames[1].this, {
"type": "object",
"className": "Number"
});
break;
case 3:
assertThisValue(3, messageObject.params.callFrames[1].this, {
"type": "object",
"className": "String"
});
break;
case 4:
assertThisValue(4, messageObject.params.callFrames[1].this, {
"type": "object",
"className": "Window"
});
break;
case 5:
assertThisValue(5, messageObject.params.callFrames[1].this, {
"type": "object",
"className": "Window"
});
break;
}
Web Inspector: use different namespaces in test fixtures for protocol tests and frontend tests https://bugs.webkit.org/show_bug.cgi?id=147787 Patch by Brian Burg <bburg@apple.com> on 2015-08-11 Reviewed by Timothy Hatcher. Refactor test methods to use three distinct namespaces to reflect their implementation: - InspectorProtocol contains commands that are only used from within protocol tests. This includes sending and receiving protocol messages and checking message errors. - InspectorTest contains test methods for full inspector frontend tests. - ProtocolTest contains test methods for protocol tests. In a subsequent patch, most methods in InspectorTest and ProtocolTest namespaces will be unified so that implementations of log, assert, etc. are no longer duplicated. For now, at least make it obvious at each callsite what code is being invoked. * http/tests/inspector/console/access-inspected-object.html: * http/tests/inspector/dom/resources/InspectorDOMListener.js: * http/tests/inspector/page/loading-iframe-document-node.html: * http/tests/inspector/resources/ProtocolTestStub.js: * http/tests/inspector/resources/console-test.js: * http/tests/inspector/resources/probe-test.js: * inspector/console/console-message.html: * inspector/console/css-source-locations.html: * inspector/console/js-source-locations.html: * inspector/console/x-frame-options-message.html: * inspector/css/getSupportedCSSProperties.html: * inspector/debugger/breakpoint-action-detach.html: * inspector/debugger/breakpoint-action-with-exception.html: * inspector/debugger/breakpoint-condition-detach.html: * inspector/debugger/breakpoint-condition-with-bad-script.html: * inspector/debugger/breakpoint-condition-with-exception.html: * inspector/debugger/breakpoint-eval-with-exception.html: * inspector/debugger/breakpoint-inside-conditons-and-actions.html: * inspector/debugger/call-frame-function-name.html: * inspector/debugger/call-frame-this-host.html: * inspector/debugger/call-frame-this-nonstrict.html: * inspector/debugger/call-frame-this-strict.html: * inspector/debugger/debugger-statement.html: * inspector/debugger/didSampleProbe-multiple-probes.html: * inspector/debugger/hit-breakpoint-from-console.html: * inspector/debugger/nested-inspectors.html: * inspector/debugger/pause-dedicated-worker.html: * inspector/debugger/pause-on-assert.html: * inspector/debugger/regress-133182.html: * inspector/debugger/removeBreakpoint.html: * inspector/debugger/searchInContent-linebreaks.html: * inspector/debugger/setBreakpoint-actions.html: * inspector/debugger/setBreakpoint-autoContinue.html: * inspector/debugger/setBreakpoint-column.html: * inspector/debugger/setBreakpoint-condition.html: * inspector/debugger/setBreakpoint-dfg-and-modify-local.html: * inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html: * inspector/debugger/setBreakpoint-dfg.html: * inspector/debugger/setBreakpoint-options-exception.html: * inspector/debugger/setBreakpoint.html: * inspector/debugger/setBreakpointByUrl-sourceURL.html: * inspector/debugger/setPauseOnExceptions-all.html: * inspector/debugger/setPauseOnExceptions-none.html: * inspector/debugger/setPauseOnExceptions-uncaught.html: * inspector/debugger/setVariableValue.html: * inspector/debugger/terminate-dedicated-worker-while-paused.html: * inspector/dom-debugger/node-removed.html: * inspector/dom/dom-remove-events.html: * inspector/dom/dom-search-crash.html: * inspector/dom/dom-search-with-context.html: * inspector/dom/dom-search.html: * inspector/dom/focus.html: * inspector/dom/getAccessibilityPropertiesForNode.html: * inspector/dom/getAccessibilityPropertiesForNode_liveRegion.html: * inspector/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html: * inspector/dom/highlight-flow-with-no-region.html: * inspector/dom/remove-multiple-nodes.html: * inspector/dom/request-child-nodes-depth.html: * inspector/layers/layers-anonymous.html: * inspector/layers/layers-blending-compositing-reasons.html: * inspector/layers/layers-compositing-reasons.html: * inspector/layers/layers-for-node.html: * inspector/layers/layers-generated-content.html: * inspector/layers/layers-reflected-content.html: * inspector/page/archive.html: * inspector/page/frameScheduledNavigation.html: * inspector/page/frameStartedLoading.html: * inspector/page/javascriptDialogEvents.html: * inspector/page/setEmulatedMedia.html: * inspector/runtime/getProperties.html: * inspector/unit-tests/async-test-suite.html: * inspector/unit-tests/sync-test-suite.html: Canonical link: https://commits.webkit.org/165990@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-08-11 18:28:31 +00:00
InspectorProtocol.sendCommand("Debugger.resume", {});
Change ScriptDebugServer to use DebuggerCallFrame instead of JavaScriptCallFrame. https://bugs.webkit.org/show_bug.cgi?id=121969. Reviewed by Geoffrey Garen. Source/JavaScriptCore: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * debugger/Debugger.cpp: * debugger/Debugger.h: * debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::DebuggerCallFrame): (JSC::DebuggerCallFrame::callerFrame): (JSC::DebuggerCallFrame::dynamicGlobalObject): (JSC::DebuggerCallFrame::sourceId): (JSC::DebuggerCallFrame::functionName): (JSC::DebuggerCallFrame::scope): (JSC::DebuggerCallFrame::type): (JSC::DebuggerCallFrame::thisValue): (JSC::DebuggerCallFrame::evaluate): (JSC::DebuggerCallFrame::evaluateWithCallFrame): (JSC::DebuggerCallFrame::invalidate): (JSC::DebuggerCallFrame::positionForCallFrame): (JSC::DebuggerCallFrame::sourceIdForCallFrame): (JSC::DebuggerCallFrame::thisValueForCallFrame): * debugger/DebuggerCallFrame.h: (JSC::DebuggerCallFrame::create): (JSC::DebuggerCallFrame::exec): (JSC::DebuggerCallFrame::line): (JSC::DebuggerCallFrame::column): (JSC::DebuggerCallFrame::position): (JSC::DebuggerCallFrame::isValid): * interpreter/StackVisitor.cpp: Source/WebCore: Tests: inspector-protocol/debugger/call-frame-function-name.html inspector-protocol/debugger/call-frame-this-host.html inspector-protocol/debugger/call-frame-this-nonstrict.html inspector-protocol/debugger/call-frame-this-strict.html 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::thisObject): * bindings/js/JavaScriptCallFrame.cpp: (WebCore::JavaScriptCallFrame::JavaScriptCallFrame): (WebCore::JavaScriptCallFrame::caller): * bindings/js/JavaScriptCallFrame.h: (WebCore::JavaScriptCallFrame::create): (WebCore::JavaScriptCallFrame::sourceID): (WebCore::JavaScriptCallFrame::position): (WebCore::JavaScriptCallFrame::line): (WebCore::JavaScriptCallFrame::column): (WebCore::JavaScriptCallFrame::functionName): (WebCore::JavaScriptCallFrame::type): (WebCore::JavaScriptCallFrame::scopeChain): (WebCore::JavaScriptCallFrame::dynamicGlobalObject): (WebCore::JavaScriptCallFrame::thisValue): (WebCore::JavaScriptCallFrame::evaluate): * bindings/js/ScriptDebugServer.cpp: (WebCore::DebuggerCallFrameScope::DebuggerCallFrameScope): (WebCore::DebuggerCallFrameScope::~DebuggerCallFrameScope): (WebCore::ScriptDebugServer::ScriptDebugServer): (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): (WebCore::ScriptDebugServer::evaluateBreakpointAction): (WebCore::ScriptDebugServer::breakProgram): (WebCore::ScriptDebugServer::stepOverStatement): (WebCore::ScriptDebugServer::stepOutOfFunction): (WebCore::ScriptDebugServer::currentDebuggerCallFrame): (WebCore::ScriptDebugServer::dispatchDidPause): (WebCore::ScriptDebugServer::updateCallFrame): (WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded): (WebCore::ScriptDebugServer::pauseIfNeeded): (WebCore::ScriptDebugServer::callEvent): (WebCore::ScriptDebugServer::returnEvent): (WebCore::ScriptDebugServer::willExecuteProgram): (WebCore::ScriptDebugServer::didExecuteProgram): * bindings/js/ScriptDebugServer.h: * bindings/js/WorkerScriptDebugServer.cpp: (WebCore::WorkerScriptDebugServer::willExecuteProgram): Source/WebKit/mac: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFramePrivate dealloc]): (-[WebScriptCallFrame _initWithGlobalObject:functionName:exceptionValue:JSC::]): (-[WebScriptCallFrame functionName]): (-[WebScriptCallFrame exception]): * WebView/WebScriptDebugger.mm: (WebScriptDebugger::exception): LayoutTests: * http/tests/inspector/debugger-test.js: (initialize_DebuggerTest): * inspector-protocol/debugger/call-frame-function-name-expected.txt: Added. * inspector-protocol/debugger/call-frame-function-name.html: Added. * inspector-protocol/debugger/call-frame-this-host-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-host.html: Added. * inspector-protocol/debugger/call-frame-this-nonstrict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-nonstrict.html: Added. * inspector-protocol/debugger/call-frame-this-strict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-strict.html: Added. * inspector/debugger/pause-in-internal-script-expected.txt: Canonical link: https://commits.webkit.org/140413@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-05 00:51:31 +00:00
if (step == 5)
Web Inspector: use different namespaces in test fixtures for protocol tests and frontend tests https://bugs.webkit.org/show_bug.cgi?id=147787 Patch by Brian Burg <bburg@apple.com> on 2015-08-11 Reviewed by Timothy Hatcher. Refactor test methods to use three distinct namespaces to reflect their implementation: - InspectorProtocol contains commands that are only used from within protocol tests. This includes sending and receiving protocol messages and checking message errors. - InspectorTest contains test methods for full inspector frontend tests. - ProtocolTest contains test methods for protocol tests. In a subsequent patch, most methods in InspectorTest and ProtocolTest namespaces will be unified so that implementations of log, assert, etc. are no longer duplicated. For now, at least make it obvious at each callsite what code is being invoked. * http/tests/inspector/console/access-inspected-object.html: * http/tests/inspector/dom/resources/InspectorDOMListener.js: * http/tests/inspector/page/loading-iframe-document-node.html: * http/tests/inspector/resources/ProtocolTestStub.js: * http/tests/inspector/resources/console-test.js: * http/tests/inspector/resources/probe-test.js: * inspector/console/console-message.html: * inspector/console/css-source-locations.html: * inspector/console/js-source-locations.html: * inspector/console/x-frame-options-message.html: * inspector/css/getSupportedCSSProperties.html: * inspector/debugger/breakpoint-action-detach.html: * inspector/debugger/breakpoint-action-with-exception.html: * inspector/debugger/breakpoint-condition-detach.html: * inspector/debugger/breakpoint-condition-with-bad-script.html: * inspector/debugger/breakpoint-condition-with-exception.html: * inspector/debugger/breakpoint-eval-with-exception.html: * inspector/debugger/breakpoint-inside-conditons-and-actions.html: * inspector/debugger/call-frame-function-name.html: * inspector/debugger/call-frame-this-host.html: * inspector/debugger/call-frame-this-nonstrict.html: * inspector/debugger/call-frame-this-strict.html: * inspector/debugger/debugger-statement.html: * inspector/debugger/didSampleProbe-multiple-probes.html: * inspector/debugger/hit-breakpoint-from-console.html: * inspector/debugger/nested-inspectors.html: * inspector/debugger/pause-dedicated-worker.html: * inspector/debugger/pause-on-assert.html: * inspector/debugger/regress-133182.html: * inspector/debugger/removeBreakpoint.html: * inspector/debugger/searchInContent-linebreaks.html: * inspector/debugger/setBreakpoint-actions.html: * inspector/debugger/setBreakpoint-autoContinue.html: * inspector/debugger/setBreakpoint-column.html: * inspector/debugger/setBreakpoint-condition.html: * inspector/debugger/setBreakpoint-dfg-and-modify-local.html: * inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html: * inspector/debugger/setBreakpoint-dfg.html: * inspector/debugger/setBreakpoint-options-exception.html: * inspector/debugger/setBreakpoint.html: * inspector/debugger/setBreakpointByUrl-sourceURL.html: * inspector/debugger/setPauseOnExceptions-all.html: * inspector/debugger/setPauseOnExceptions-none.html: * inspector/debugger/setPauseOnExceptions-uncaught.html: * inspector/debugger/setVariableValue.html: * inspector/debugger/terminate-dedicated-worker-while-paused.html: * inspector/dom-debugger/node-removed.html: * inspector/dom/dom-remove-events.html: * inspector/dom/dom-search-crash.html: * inspector/dom/dom-search-with-context.html: * inspector/dom/dom-search.html: * inspector/dom/focus.html: * inspector/dom/getAccessibilityPropertiesForNode.html: * inspector/dom/getAccessibilityPropertiesForNode_liveRegion.html: * inspector/dom/getAccessibilityPropertiesForNode_mouseEventNodeId.html: * inspector/dom/highlight-flow-with-no-region.html: * inspector/dom/remove-multiple-nodes.html: * inspector/dom/request-child-nodes-depth.html: * inspector/layers/layers-anonymous.html: * inspector/layers/layers-blending-compositing-reasons.html: * inspector/layers/layers-compositing-reasons.html: * inspector/layers/layers-for-node.html: * inspector/layers/layers-generated-content.html: * inspector/layers/layers-reflected-content.html: * inspector/page/archive.html: * inspector/page/frameScheduledNavigation.html: * inspector/page/frameStartedLoading.html: * inspector/page/javascriptDialogEvents.html: * inspector/page/setEmulatedMedia.html: * inspector/runtime/getProperties.html: * inspector/unit-tests/async-test-suite.html: * inspector/unit-tests/sync-test-suite.html: Canonical link: https://commits.webkit.org/165990@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-08-11 18:28:31 +00:00
ProtocolTest.completeTest();
Change ScriptDebugServer to use DebuggerCallFrame instead of JavaScriptCallFrame. https://bugs.webkit.org/show_bug.cgi?id=121969. Reviewed by Geoffrey Garen. Source/JavaScriptCore: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * debugger/Debugger.cpp: * debugger/Debugger.h: * debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::DebuggerCallFrame): (JSC::DebuggerCallFrame::callerFrame): (JSC::DebuggerCallFrame::dynamicGlobalObject): (JSC::DebuggerCallFrame::sourceId): (JSC::DebuggerCallFrame::functionName): (JSC::DebuggerCallFrame::scope): (JSC::DebuggerCallFrame::type): (JSC::DebuggerCallFrame::thisValue): (JSC::DebuggerCallFrame::evaluate): (JSC::DebuggerCallFrame::evaluateWithCallFrame): (JSC::DebuggerCallFrame::invalidate): (JSC::DebuggerCallFrame::positionForCallFrame): (JSC::DebuggerCallFrame::sourceIdForCallFrame): (JSC::DebuggerCallFrame::thisValueForCallFrame): * debugger/DebuggerCallFrame.h: (JSC::DebuggerCallFrame::create): (JSC::DebuggerCallFrame::exec): (JSC::DebuggerCallFrame::line): (JSC::DebuggerCallFrame::column): (JSC::DebuggerCallFrame::position): (JSC::DebuggerCallFrame::isValid): * interpreter/StackVisitor.cpp: Source/WebCore: Tests: inspector-protocol/debugger/call-frame-function-name.html inspector-protocol/debugger/call-frame-this-host.html inspector-protocol/debugger/call-frame-this-nonstrict.html inspector-protocol/debugger/call-frame-this-strict.html 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::thisObject): * bindings/js/JavaScriptCallFrame.cpp: (WebCore::JavaScriptCallFrame::JavaScriptCallFrame): (WebCore::JavaScriptCallFrame::caller): * bindings/js/JavaScriptCallFrame.h: (WebCore::JavaScriptCallFrame::create): (WebCore::JavaScriptCallFrame::sourceID): (WebCore::JavaScriptCallFrame::position): (WebCore::JavaScriptCallFrame::line): (WebCore::JavaScriptCallFrame::column): (WebCore::JavaScriptCallFrame::functionName): (WebCore::JavaScriptCallFrame::type): (WebCore::JavaScriptCallFrame::scopeChain): (WebCore::JavaScriptCallFrame::dynamicGlobalObject): (WebCore::JavaScriptCallFrame::thisValue): (WebCore::JavaScriptCallFrame::evaluate): * bindings/js/ScriptDebugServer.cpp: (WebCore::DebuggerCallFrameScope::DebuggerCallFrameScope): (WebCore::DebuggerCallFrameScope::~DebuggerCallFrameScope): (WebCore::ScriptDebugServer::ScriptDebugServer): (WebCore::ScriptDebugServer::setBreakpoint): (WebCore::ScriptDebugServer::removeBreakpoint): (WebCore::ScriptDebugServer::hasBreakpoint): (WebCore::ScriptDebugServer::evaluateBreakpointAction): (WebCore::ScriptDebugServer::breakProgram): (WebCore::ScriptDebugServer::stepOverStatement): (WebCore::ScriptDebugServer::stepOutOfFunction): (WebCore::ScriptDebugServer::currentDebuggerCallFrame): (WebCore::ScriptDebugServer::dispatchDidPause): (WebCore::ScriptDebugServer::updateCallFrame): (WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded): (WebCore::ScriptDebugServer::pauseIfNeeded): (WebCore::ScriptDebugServer::callEvent): (WebCore::ScriptDebugServer::returnEvent): (WebCore::ScriptDebugServer::willExecuteProgram): (WebCore::ScriptDebugServer::didExecuteProgram): * bindings/js/ScriptDebugServer.h: * bindings/js/WorkerScriptDebugServer.cpp: (WebCore::WorkerScriptDebugServer::willExecuteProgram): Source/WebKit/mac: 1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame. DebuggerCallFrame now tracks whether it is valid instead of needing JavaScriptCallFrame do it. 2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed just before it pauses and calls back to its client, and then invalidates it immediately when the callback returns. Every subsequent callback to the client will use a new instance of the DebuggerCallFrame. 3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when it "pauses". 4. DebuggerCallFrame only creates its caller DebuggerCallFrame when it is needed i.e. when the client calls callerFrame(). Similarly, JavaScriptCallFrame only creates its caller when it's requested. 5. DebuggerCallFrame's line() and column() now returns a base-zero int. 6. WebScriptDebugDelegate now only caches the functionName of the frame instead of the entire DebuggerCallFrame because that is all that is needed. 7. Also removed evaluateInGlobalCallFrame() which is not used anywhere. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFramePrivate dealloc]): (-[WebScriptCallFrame _initWithGlobalObject:functionName:exceptionValue:JSC::]): (-[WebScriptCallFrame functionName]): (-[WebScriptCallFrame exception]): * WebView/WebScriptDebugger.mm: (WebScriptDebugger::exception): LayoutTests: * http/tests/inspector/debugger-test.js: (initialize_DebuggerTest): * inspector-protocol/debugger/call-frame-function-name-expected.txt: Added. * inspector-protocol/debugger/call-frame-function-name.html: Added. * inspector-protocol/debugger/call-frame-this-host-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-host.html: Added. * inspector-protocol/debugger/call-frame-this-nonstrict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-nonstrict.html: Added. * inspector-protocol/debugger/call-frame-this-strict-expected.txt: Added. * inspector-protocol/debugger/call-frame-this-strict.html: Added. * inspector/debugger/pause-in-internal-script-expected.txt: Canonical link: https://commits.webkit.org/140413@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-05 00:51:31 +00:00
step++;
}
}
</script>
</head>
<body>
<p>Debugger.setBreakpoint on line:column in &lt;script&gt;</p>
<script>// Line 0
// Line 1
function breakWithMessage(message) { // Line 2
message; // Line 3
}
function accessThis() {
breakWithMessage("this is " + this);
}
function dontAccessThis() {
breakWithMessage("not accessing this");
}
function testFunction() {
var thisValue = 2;
accessThis.bind(thisValue)();
thisValue = "Hello";
accessThis.bind(thisValue)();
thisValue = 2;
dontAccessThis.bind(thisValue)();
thisValue = "Hello";
dontAccessThis.bind(thisValue)();
function foo() {
var fooStuff = 1;
function goo() {
accessThis();
dontAccessThis();
return fooStuff;
}
goo();
}
foo();
}
</script>
</body>
</html>