haikuwebkit/LayoutTests/inspector/runtime/evaluate-emulateUserGesture...

10 lines
256 B
Plaintext
Raw Permalink Normal View History

Allow emulation of user gestures from Web Inspector console https://bugs.webkit.org/show_bug.cgi?id=194725 <rdar://problem/48126604> Reviewed by Joseph Pecoraro and Devin Rousso. Source/JavaScriptCore: * inspector/agents/InspectorRuntimeAgent.cpp: Add a new optional parameter, emulateUserGesture, to the evaluate function, and mark the function as override so that PageRuntimeAgent can change the behaviour. (Inspector::InspectorRuntimeAgent::evaluate): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebCore: Test: inspector/runtime/evaluate-userGestureEmulation.html * inspector/agents/page/PageRuntimeAgent.cpp: Override the emulate method and create a UserGestureIndicator based on the emulateUserGesture option. (WebCore::PageRuntimeAgent::evaluate): * inspector/agents/page/PageRuntimeAgent.h: Source/WebInspectorUI: Add some UI for emulating a User Gesture when evaluating in the console. This allows the developer to do things that would otherwise require actual interaction with the page, such as start playback of media on iOS. * Localizations/en.lproj/localizedStrings.js: * UserInterface/Base/Setting.js: Add a new setting for this option. * UserInterface/Controllers/JavaScriptLogViewController.js: (WI.JavaScriptLogViewController.prototype.consolePromptTextCommitted): * UserInterface/Controllers/RuntimeManager.js: Call evaluate with this new option. (WI.RuntimeManager.prototype.evaluateInInspectedWindow): * UserInterface/Views/LogContentView.js: Add a new checkbox in the upper bar that allows the user to toggle the setting. (WI.LogContentView): (WI.LogContentView.prototype.get navigationItems): (WI.LogContentView.prototype._handleEmulateInUserGestureSettingChanged): * UserInterface/Views/NetworkTableContentView.js: Two drive-by typo fixes :) (WI.NetworkTableContentView): perserve -> preserve (WI.NetworkTableContentView.prototype.get navigationItems): checkboxs -> checkboxes LayoutTests: * inspector/runtime/evaluate-userGestureEmulation-expected.txt: Added. * inspector/runtime/evaluate-userGestureEmulation.html: Added. Canonical link: https://commits.webkit.org/209126@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241633 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-16 00:52:56 +00:00
Tests for Runtime emulateUserGesture option.
Web Inspector: Debugger: support emulateUserGesture parameter in Debugger.evaluateOnCallFrame https://bugs.webkit.org/show_bug.cgi?id=200272 Reviewed by Joseph Pecoraro. Source/JavaScriptCore: When paused, evaluating in the console should still respect the "Emulate User Gesture" checkbox. * inspector/protocol/Debugger.json: * inspector/agents/InspectorDebuggerAgent.h: * inspector/agents/InspectorDebuggerAgent.cpp: (Inspector::InspectorDebuggerAgent::evaluateOnCallFrame): Source/WebCore: When paused, evaluating in the console should still respect the "Emulate User Gesture" checkbox. Tests: inspector/debugger/evaluateOnCallFrame-emulateUserGesture.html inspector/debugger/evaluateOnCallFrame-emulateUserGesture-userIsInteracting.html * inspector/agents/page/PageDebuggerAgent.h: * inspector/agents/page/PageDebuggerAgent.cpp: (WebCore::PageDebuggerAgent::evaluateOnCallFrame): Added. Source/WebInspectorUI: When paused, evaluating in the console should still respect the "Emulate User Gesture" checkbox. * UserInterface/Controllers/RuntimeManager.js: (WI.RuntimeManager.prototype.evaluateInInspectedWindow): * UserInterface/Protocol/Legacy/13.0/InspectorBackendCommands.js: * Versions/Inspector-iOS-13.0.json: LayoutTests: * inspector/debugger/evaluateOnCallFrame-emulateUserGesture.html: Added. * inspector/debugger/evaluateOnCallFrame-emulateUserGesture-expected.txt: Added. * inspector/debugger/evaluateOnCallFrame-emulateUserGesture-userIsInteracting.html: Added. * inspector/debugger/evaluateOnCallFrame-emulateUserGesture-userIsInteracting-expected.txt: Added. * TestExpectations: * platform/wk2/TestExpectations: * inspector/runtime/evaluate-emulateUserGesture.html: Added. * inspector/runtime/evaluate-emulateUserGesture-expected.txt: Added. * inspector/runtime/evaluate-emulateUserGesture-userIsInteracting.html: Added. * inspector/runtime/evaluate-emulateUserGesture-userIsInteracting-expected.txt: Added. * inspector/runtime/evaluate-userGestureEmulation.html: Deleted. * inspector/runtime/evaluate-userGestureEmulation-expected.txt: Deleted. * inspector/runtime/evaluate-userGestureEmulation-userIsInteracting.html: Deleted. * inspector/runtime/evaluate-userGestureEmulation-userIsInteracting-expected.txt: Deleted. Rename tests from "userGestureEmulation" to "emulateUserGesture" to match the parameter. Canonical link: https://commits.webkit.org/214117@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248097 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-01 05:19:27 +00:00
== Running test suite: Runtime.evaluate.emulateUserGesture
Allow emulation of user gestures from Web Inspector console https://bugs.webkit.org/show_bug.cgi?id=194725 <rdar://problem/48126604> Reviewed by Joseph Pecoraro and Devin Rousso. Source/JavaScriptCore: * inspector/agents/InspectorRuntimeAgent.cpp: Add a new optional parameter, emulateUserGesture, to the evaluate function, and mark the function as override so that PageRuntimeAgent can change the behaviour. (Inspector::InspectorRuntimeAgent::evaluate): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebCore: Test: inspector/runtime/evaluate-userGestureEmulation.html * inspector/agents/page/PageRuntimeAgent.cpp: Override the emulate method and create a UserGestureIndicator based on the emulateUserGesture option. (WebCore::PageRuntimeAgent::evaluate): * inspector/agents/page/PageRuntimeAgent.h: Source/WebInspectorUI: Add some UI for emulating a User Gesture when evaluating in the console. This allows the developer to do things that would otherwise require actual interaction with the page, such as start playback of media on iOS. * Localizations/en.lproj/localizedStrings.js: * UserInterface/Base/Setting.js: Add a new setting for this option. * UserInterface/Controllers/JavaScriptLogViewController.js: (WI.JavaScriptLogViewController.prototype.consolePromptTextCommitted): * UserInterface/Controllers/RuntimeManager.js: Call evaluate with this new option. (WI.RuntimeManager.prototype.evaluateInInspectedWindow): * UserInterface/Views/LogContentView.js: Add a new checkbox in the upper bar that allows the user to toggle the setting. (WI.LogContentView): (WI.LogContentView.prototype.get navigationItems): (WI.LogContentView.prototype._handleEmulateInUserGestureSettingChanged): * UserInterface/Views/NetworkTableContentView.js: Two drive-by typo fixes :) (WI.NetworkTableContentView): perserve -> preserve (WI.NetworkTableContentView.prototype.get navigationItems): checkboxs -> checkboxes LayoutTests: * inspector/runtime/evaluate-userGestureEmulation-expected.txt: Added. * inspector/runtime/evaluate-userGestureEmulation.html: Added. Canonical link: https://commits.webkit.org/209126@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241633 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-16 00:52:56 +00:00
-- Running test case: EvaluateWithoutEmulatingUserGesture
Not in User Gesture
-- Running test case: EvaluateWithEmulatingUserGesture
In User Gesture