chrome-devtools-frontend 1.0.1376716 → 1.0.1380117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/gni/devtools_grd_files.gni +15 -7
- package/config/gni/devtools_image_files.gni +2 -0
- package/front_end/Images/src/animation.svg +3 -0
- package/front_end/Images/src/brush-2.svg +3 -0
- package/front_end/core/common/SettingRegistration.ts +1 -1
- package/front_end/core/host/AidaClient.ts +1 -0
- package/front_end/core/host/InspectorFrontendHost.ts +4 -0
- package/front_end/core/i18n/ByteUtilities.test.ts +34 -0
- package/front_end/core/i18n/ByteUtilities.ts +65 -0
- package/front_end/core/i18n/NumberFormatter.ts +75 -0
- package/front_end/core/i18n/i18n.ts +4 -0
- package/front_end/core/i18n/time-utilities.test.ts +20 -2
- package/front_end/core/i18n/time-utilities.ts +125 -86
- package/front_end/core/platform/NumberUtilities.test.ts +3 -26
- package/front_end/core/platform/NumberUtilities.ts +0 -20
- package/front_end/core/root/Runtime.ts +6 -3
- package/front_end/core/sdk/CPUThrottlingManager.ts +4 -0
- package/front_end/core/sdk/CSSContainerQuery.test.ts +10 -16
- package/front_end/core/sdk/CSSContainerQuery.ts +3 -15
- package/front_end/core/sdk/CSSMatchedStyles.test.ts +4 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +5 -5
- package/front_end/core/sdk/CSSModel.ts +18 -0
- package/front_end/core/sdk/CSSPropertyParser.test.ts +16 -1
- package/front_end/core/sdk/CSSPropertyParser.ts +2 -2
- package/front_end/core/sdk/sdk-meta.ts +8 -0
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +3 -3
- package/front_end/generated/ARIAProperties.js +4 -0
- package/front_end/generated/InspectorBackendCommands.js +8 -6
- package/front_end/generated/SupportedCSSProperties.js +17 -4
- package/front_end/generated/protocol-mapping.d.ts +15 -1
- package/front_end/generated/protocol-proxy-api.d.ts +14 -1
- package/front_end/generated/protocol.ts +26 -2
- package/front_end/models/extensions/ExtensionAPI.ts +9 -1
- package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +8 -21
- package/front_end/models/live-metrics/web-vitals-injected/{rollup.config.js → rollup.config.mjs} +1 -1
- package/front_end/models/persistence/EditFileSystemView.ts +19 -9
- package/front_end/models/persistence/WorkspaceSettingsTab.ts +50 -54
- package/front_end/models/persistence/editFileSystemView.css +35 -15
- package/front_end/models/persistence/workspaceSettingsTab.css +21 -87
- package/front_end/models/timeline_model/timeline_model.ts +0 -6
- package/front_end/models/trace/Processor.test.ts +18 -17
- package/front_end/models/trace/Processor.ts +10 -14
- package/front_end/models/trace/README.md +0 -1
- package/front_end/models/{timeline_model → trace/extras}/TimelineJSProfile.ts +19 -29
- package/front_end/models/{timeline_model/TimelineModelFilter.test.ts → trace/extras/TraceFilter.test.ts} +15 -17
- package/front_end/models/trace/extras/TraceFilter.ts +62 -0
- package/front_end/models/{timeline_model/TimelineProfileTree.test.ts → trace/extras/TraceTree.test.ts} +44 -43
- package/front_end/models/{timeline_model/TimelineProfileTree.ts → trace/extras/TraceTree.ts} +65 -59
- package/front_end/models/trace/extras/extras.ts +3 -0
- package/front_end/models/trace/handlers/AnimationHandler.ts +0 -8
- package/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +1 -11
- package/front_end/models/trace/handlers/FramesHandler.test.ts +1 -6
- package/front_end/models/trace/handlers/FramesHandler.ts +1 -14
- package/front_end/models/trace/handlers/GPUHandler.test.ts +0 -2
- package/front_end/models/trace/handlers/GPUHandler.ts +1 -25
- package/front_end/models/trace/handlers/ImagePaintingHandler.ts +3 -0
- package/front_end/models/trace/handlers/InitiatorsHandler.test.ts +0 -1
- package/front_end/models/trace/handlers/InitiatorsHandler.ts +0 -20
- package/front_end/models/trace/handlers/InvalidationsHandler.test.ts +0 -1
- package/front_end/models/trace/handlers/InvalidationsHandler.ts +0 -18
- package/front_end/models/trace/handlers/LargestImagePaintHandler.test.ts +2 -2
- package/front_end/models/trace/handlers/LargestImagePaintHandler.ts +63 -3
- package/front_end/models/trace/handlers/LargestTextPaintHandler.ts +3 -0
- package/front_end/models/trace/handlers/LayerTreeHandler.test.ts +0 -2
- package/front_end/models/trace/handlers/LayerTreeHandler.ts +1 -18
- package/front_end/models/trace/handlers/LayoutShiftsHandler.test.ts +0 -3
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +1 -20
- package/front_end/models/trace/handlers/MemoryHandler.test.ts +0 -1
- package/front_end/models/trace/handlers/MemoryHandler.ts +3 -0
- package/front_end/models/trace/handlers/MetaHandler.test.ts +1 -32
- package/front_end/models/trace/handlers/MetaHandler.ts +2 -30
- package/front_end/models/trace/handlers/NetworkRequestsHandler.test.ts +0 -26
- package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +4 -23
- package/front_end/models/trace/handlers/PageFramesHandler.ts +3 -0
- package/front_end/models/trace/handlers/RendererHandler.test.ts +0 -4
- package/front_end/models/trace/handlers/RendererHandler.ts +1 -24
- package/front_end/models/trace/handlers/SamplesHandler.test.ts +0 -5
- package/front_end/models/trace/handlers/SamplesHandler.ts +0 -26
- package/front_end/models/trace/handlers/ScreenshotsHandler.test.ts +0 -1
- package/front_end/models/trace/handlers/SelectorStatsHandler.ts +3 -0
- package/front_end/models/trace/handlers/ServerTimingsHandler.ts +1 -16
- package/front_end/models/trace/handlers/Threads.test.ts +1 -2
- package/front_end/models/trace/handlers/UserInteractionsHandler.test.ts +4 -27
- package/front_end/models/trace/handlers/UserInteractionsHandler.ts +16 -25
- package/front_end/models/trace/handlers/UserTimingsHandler.ts +0 -17
- package/front_end/models/trace/handlers/WorkersHandler.test.ts +0 -1
- package/front_end/models/trace/handlers/WorkersHandler.ts +0 -23
- package/front_end/models/trace/handlers/types.ts +1 -8
- package/front_end/models/trace/insights/{CumulativeLayoutShift.test.ts → CLSCulprits.test.ts} +21 -21
- package/front_end/models/trace/insights/{CumulativeLayoutShift.ts → CLSCulprits.ts} +24 -5
- package/front_end/models/trace/insights/Common.ts +5 -55
- package/front_end/models/trace/insights/DocumentLatency.test.ts +2 -2
- package/front_end/models/trace/insights/DocumentLatency.ts +26 -6
- package/front_end/models/trace/insights/FontDisplay.ts +24 -5
- package/front_end/models/trace/insights/InteractionToNextPaint.test.ts +1 -1
- package/front_end/models/trace/insights/InteractionToNextPaint.ts +26 -6
- package/front_end/models/trace/insights/LCPDiscovery.test.ts +58 -0
- package/front_end/models/trace/insights/LCPDiscovery.ts +101 -0
- package/front_end/models/trace/insights/{LargestContentfulPaint.test.ts → LCPPhases.test.ts} +6 -28
- package/front_end/models/trace/insights/{LargestContentfulPaint.ts → LCPPhases.ts} +37 -38
- package/front_end/models/trace/insights/{InsightRunners.ts → Models.ts} +4 -3
- package/front_end/models/trace/insights/RenderBlocking.test.ts +1 -1
- package/front_end/models/trace/insights/RenderBlocking.ts +33 -28
- package/front_end/models/trace/insights/SlowCSSSelector.ts +26 -5
- package/front_end/models/trace/insights/{ThirdPartyWeb.test.ts → ThirdParties.test.ts} +3 -3
- package/front_end/models/trace/insights/{ThirdPartyWeb.ts → ThirdParties.ts} +24 -5
- package/front_end/models/trace/insights/Viewport.test.ts +1 -1
- package/front_end/models/trace/insights/Viewport.ts +27 -9
- package/front_end/models/trace/insights/insights.ts +1 -1
- package/front_end/models/trace/insights/types.ts +11 -9
- package/front_end/models/trace/types/TraceEvents.ts +51 -22
- package/front_end/panels/application/SharedStorageItemsView.test.ts +3 -3
- package/front_end/panels/application/SharedStorageItemsView.ts +5 -3
- package/front_end/panels/application/StorageView.ts +3 -3
- package/front_end/panels/application/components/StorageMetadataView.ts +1 -2
- package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +34 -31
- package/front_end/panels/coverage/CoverageView.ts +3 -3
- package/front_end/panels/elements/ComputedStyleModel.ts +9 -2
- package/front_end/panels/elements/ComputedStyleWidget.test.ts +72 -0
- package/front_end/panels/elements/ComputedStyleWidget.ts +12 -0
- package/front_end/panels/elements/ElementStatePaneWidget.test.ts +84 -30
- package/front_end/panels/elements/ElementStatePaneWidget.ts +42 -24
- package/front_end/panels/elements/ElementsTreeElement.ts +24 -11
- package/front_end/panels/elements/MetricsSidebarPane.ts +12 -7
- package/front_end/panels/elements/PropertyMatchers.ts +3 -0
- package/front_end/panels/elements/StylePropertiesSection.ts +15 -6
- package/front_end/panels/elements/StylePropertyTreeElement.test.ts +3 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -3
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +2 -2
- package/front_end/panels/explain/components/ConsoleInsight.ts +8 -18
- package/front_end/panels/freestyler/AiAgent.test.ts +58 -1
- package/front_end/panels/freestyler/AiAgent.ts +58 -3
- package/front_end/panels/freestyler/DrJonesFileAgent.test.ts +99 -23
- package/front_end/panels/freestyler/DrJonesFileAgent.ts +53 -20
- package/front_end/panels/freestyler/DrJonesNetworkAgent.test.ts +15 -7
- package/front_end/panels/freestyler/DrJonesNetworkAgent.ts +36 -15
- package/front_end/panels/freestyler/DrJonesPerformanceAgent.test.ts +6 -6
- package/front_end/panels/freestyler/DrJonesPerformanceAgent.ts +48 -8
- package/front_end/panels/freestyler/FreestylerAgent.test.ts +15 -14
- package/front_end/panels/freestyler/FreestylerAgent.ts +52 -8
- package/front_end/panels/freestyler/FreestylerPanel.test.ts +539 -39
- package/front_end/panels/freestyler/FreestylerPanel.ts +349 -215
- package/front_end/panels/freestyler/components/FreestylerChatUi.test.ts +126 -34
- package/front_end/panels/freestyler/components/FreestylerChatUi.ts +320 -268
- package/front_end/panels/freestyler/components/UserActionRow.ts +156 -47
- package/front_end/panels/freestyler/components/freestylerChatUi.css +69 -34
- package/front_end/panels/freestyler/components/userActionRow.css +40 -67
- package/front_end/panels/freestyler/freestyler-meta.ts +3 -11
- package/front_end/panels/issues/components/HideIssuesMenu.ts +2 -11
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +1 -2
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +5 -5
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +46 -0
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +26 -17
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +25 -19
- package/front_end/panels/network/BinaryResourceView.ts +6 -7
- package/front_end/panels/network/EventSourceMessagesView.ts +1 -1
- package/front_end/panels/network/NetworkDataGridNode.ts +3 -3
- package/front_end/panels/network/NetworkLogView.ts +7 -8
- package/front_end/panels/network/RequestTimingView.test.ts +35 -1
- package/front_end/panels/network/RequestTimingView.ts +96 -0
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +2 -2
- package/front_end/panels/network/networkTimingTable.css +2 -1
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +1 -1
- package/front_end/panels/profiler/HeapProfileView.ts +3 -3
- package/front_end/panels/profiler/HeapSnapshotView.ts +2 -2
- package/front_end/panels/profiler/HeapTimelineOverview.ts +12 -12
- package/front_end/panels/profiler/IsolateSelector.ts +3 -4
- package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +1 -1
- package/front_end/panels/profiler/ProfileSidebarTreeElement.ts +7 -6
- package/front_end/panels/profiler/ProfileView.ts +1 -1
- package/front_end/panels/recorder/components/RecordingView.ts +2 -2
- package/front_end/panels/recorder/injected/{rollup.config.js → rollup.config.mjs} +1 -1
- package/front_end/panels/recorder/recorderController.css +0 -4
- package/front_end/panels/security/CookieReportTreeElement.ts +1 -9
- package/front_end/panels/security/CookieReportView.ts +120 -0
- package/front_end/panels/security/SecurityPanel.ts +8 -2
- package/front_end/panels/security/cookieReportView.css +46 -0
- package/front_end/panels/security/sidebar.css +1 -2
- package/front_end/panels/sensors/LocationsSettingsTab.ts +26 -11
- package/front_end/panels/sensors/locationsSettingsTab.css +18 -18
- package/front_end/panels/settings/AISettingsTab.ts +6 -15
- package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +61 -56
- package/front_end/panels/settings/aiSettingsTab.css +3 -14
- package/front_end/panels/settings/components/SyncSection.ts +1 -2
- package/front_end/panels/settings/components/syncSection.css +0 -10
- package/front_end/panels/settings/frameworkIgnoreListSettingsTab.css +3 -1
- package/front_end/panels/settings/keybindsSettingsTab.css +7 -10
- package/front_end/panels/settings/settingsScreen.css +27 -125
- package/front_end/panels/sources/DebuggerPlugin.ts +9 -4
- package/front_end/panels/sources/NavigatorView.ts +11 -13
- package/front_end/panels/timeline/ActiveFilters.ts +3 -4
- package/front_end/panels/timeline/AnimationsTrackAppender.ts +1 -2
- package/front_end/panels/timeline/CountersGraph.ts +2 -4
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +7 -8
- package/front_end/panels/timeline/README.md +2 -1
- package/front_end/panels/timeline/TimelineController.ts +14 -4
- package/front_end/panels/timeline/TimelineEventOverview.ts +3 -4
- package/front_end/panels/timeline/TimelineFilters.ts +3 -4
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.test.ts +1 -1
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +3 -10
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +1 -2
- package/front_end/panels/timeline/TimelineFlameChartView.ts +21 -12
- package/front_end/panels/timeline/TimelineLoader.test.ts +1 -2
- package/front_end/panels/timeline/TimelineLoader.ts +3 -4
- package/front_end/panels/timeline/TimelineMiniMap.ts +10 -0
- package/front_end/panels/timeline/TimelinePanel.ts +20 -8
- package/front_end/panels/timeline/TimelineTreeView.test.ts +12 -13
- package/front_end/panels/timeline/TimelineTreeView.ts +35 -40
- package/front_end/panels/timeline/TimelineUIUtils.test.ts +2 -2
- package/front_end/panels/timeline/TimelineUIUtils.ts +12 -14
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +6 -7
- package/front_end/panels/timeline/components/LiveMetricsView.test.ts +3 -3
- package/front_end/panels/timeline/components/LiveMetricsView.ts +14 -26
- package/front_end/panels/timeline/components/MetricCard.test.ts +1 -1
- package/front_end/panels/timeline/components/MetricCard.ts +46 -0
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +3 -4
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.test.ts +2 -0
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +41 -36
- package/front_end/panels/timeline/components/insights/CLSCulprits.ts +19 -33
- package/front_end/panels/timeline/components/insights/DocumentLatency.ts +29 -40
- package/front_end/panels/timeline/components/insights/FontDisplay.ts +17 -23
- package/front_end/panels/timeline/components/insights/Helpers.ts +12 -16
- package/front_end/panels/timeline/components/insights/InteractionToNextPaint.ts +14 -26
- package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +25 -37
- package/front_end/panels/timeline/components/insights/LCPPhases.ts +20 -47
- package/front_end/panels/timeline/components/insights/RenderBlocking.ts +19 -28
- package/front_end/panels/timeline/components/insights/SidebarInsight.ts +1 -2
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +18 -31
- package/front_end/panels/timeline/components/insights/Table.ts +5 -3
- package/front_end/panels/timeline/components/insights/ThirdParties.ts +18 -25
- package/front_end/panels/timeline/components/insights/Viewport.ts +14 -25
- package/front_end/panels/timeline/components/liveMetricsView.css +5 -13
- package/front_end/panels/timeline/components/metricCard.css +11 -0
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +1 -1
- package/front_end/panels/timeline/overlays/OverlaysImpl.test.ts +5 -5
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +13 -12
- package/front_end/panels/timeline/timelineFlameChartView.css +1 -1
- package/front_end/panels/timeline/utils/AICallTree.test.ts +105 -0
- package/front_end/panels/timeline/utils/AICallTree.ts +25 -24
- package/front_end/testing/EnvironmentHelpers.ts +5 -18
- package/front_end/testing/InsightHelpers.ts +4 -4
- package/front_end/testing/TraceHelpers.ts +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +2 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts +14 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js +16 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Input.d.ts +34 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Input.js +51 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.js +10 -8
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.d.ts +14 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.js +57 -23
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.js +13 -10
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Input.d.ts +15 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Input.js +55 -26
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts +0 -8
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js +2 -11
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.js +9 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WaitTask.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WaitTask.js +5 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WaitTask.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.js +0 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/incremental-id-generator.d.ts +14 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/incremental-id-generator.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/incremental-id-generator.js +18 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/incremental-id-generator.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +51 -10
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +215 -97
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +2 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts +14 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js +16 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.d.ts +34 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.js +51 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.js +10 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.d.ts +14 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.js +57 -23
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.js +13 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Input.d.ts +15 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Input.js +55 -26
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts +0 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js +1 -9
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WaitTask.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WaitTask.js +5 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WaitTask.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.js +0 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/incremental-id-generator.d.ts +14 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/incremental-id-generator.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/incremental-id-generator.js +15 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/incremental-id-generator.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +51 -10
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +2 -3
- package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +21 -3
- package/front_end/third_party/puppeteer/package/src/api/Input.ts +57 -8
- package/front_end/third_party/puppeteer/package/src/bidi/ElementHandle.ts +9 -7
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Input.ts +72 -31
- package/front_end/third_party/puppeteer/package/src/cdp/ElementHandle.ts +14 -9
- package/front_end/third_party/puppeteer/package/src/cdp/Input.ts +71 -26
- package/front_end/third_party/puppeteer/package/src/common/CallbackRegistry.ts +1 -15
- package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +8 -1
- package/front_end/third_party/puppeteer/package/src/common/Errors.ts +7 -0
- package/front_end/third_party/puppeteer/package/src/common/WaitTask.ts +9 -9
- package/front_end/third_party/puppeteer/package/src/environment.ts +1 -4
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/incremental-id-generator.ts +20 -0
- package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +1 -0
- package/front_end/ui/components/buttons/Button.test.ts +14 -0
- package/front_end/ui/components/buttons/Button.ts +27 -4
- package/front_end/ui/components/cards/card.css +7 -4
- package/front_end/ui/components/dialogs/Dialog.ts +2 -4
- package/front_end/ui/components/dialogs/ShortcutDialog.ts +15 -13
- package/front_end/ui/components/dialogs/dialog.css +2 -6
- package/front_end/ui/components/dialogs/shortcutDialog.css +33 -41
- package/front_end/ui/components/docs/freestyler/basic.ts +6 -8
- package/front_end/ui/components/docs/freestyler/empty_state.ts +6 -8
- package/front_end/ui/components/docs/performance_panel/track_example.html +1 -1
- package/front_end/ui/components/markdown_view/MarkdownView.test.ts +39 -17
- package/front_end/ui/components/markdown_view/MarkdownView.ts +77 -14
- package/front_end/ui/components/markdown_view/markdownView.css +15 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +3 -2
- package/front_end/ui/legacy/ContextMenu.ts +2 -2
- package/front_end/ui/legacy/InplaceEditor.ts +18 -14
- package/front_end/ui/legacy/TabbedPane.ts +0 -14
- package/front_end/ui/legacy/UIUtils.ts +0 -7
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +7 -2
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +8 -4
- package/front_end/ui/legacy/components/data_grid/ViewportDataGrid.ts +20 -11
- package/front_end/ui/legacy/components/inline_editor/LinkSwatch.test.ts +19 -0
- package/front_end/ui/legacy/components/inline_editor/LinkSwatch.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +5 -22
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +129 -100
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +4 -2
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewCalculator.test.ts +9 -4
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewCalculator.ts +6 -6
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +22 -4
- package/front_end/ui/legacy/components/perf_ui/flameChart.css +0 -2
- package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.test.ts +49 -0
- package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +23 -46
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -1
- package/front_end/ui/legacy/components/utils/ImagePreview.ts +1 -1
- package/front_end/ui/legacy/textPrompt.css +1 -1
- package/front_end/ui/legacy/toolbar.css +4 -5
- package/front_end/ui/visual_logging/KnownContextValues.ts +174 -0
- package/front_end/ui/visual_logging/LoggingConfig.ts +6 -2
- package/package.json +7 -6
- package/scripts/build/ninja/bundle.gni +3 -3
- package/scripts/build/{rollup.config.js → rollup.config.mjs} +4 -4
- package/scripts/devtools_paths.py +8 -4
- package/scripts/eslint_rules/tests/check_test_definitions_test.js +8 -3
- package/scripts/tools/update_goldens_v2.py +1 -1
- package/front_end/models/timeline_model/TimelineModelFilter.ts +0 -61
- /package/front_end/Images/{rollup.config.js → rollup.config.mjs} +0 -0
@@ -4,14 +4,20 @@
|
|
4
4
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
6
6
|
import * as Host from '../../core/host/host.js';
|
7
|
+
import type * as Platform from '../../core/platform/platform.js';
|
7
8
|
import * as SDK from '../../core/sdk/sdk.js';
|
8
9
|
import * as Workspace from '../../models/workspace/workspace.js';
|
9
10
|
import {findMenuItemWithLabel, getMenu} from '../../testing/ContextMenuHelpers.js';
|
10
11
|
import {dispatchClickEvent} from '../../testing/DOMHelpers.js';
|
11
12
|
import {describeWithEnvironment, getGetHostConfigStub, registerNoopActions} from '../../testing/EnvironmentHelpers.js';
|
12
13
|
import * as UI from '../../ui/legacy/legacy.js';
|
14
|
+
import * as ElementsPanel from '../elements/elements.js';
|
15
|
+
import * as NetworkPanel from '../network/network.js';
|
16
|
+
import * as SourcesPanel from '../sources/sources.js';
|
17
|
+
import * as TimelinePanel from '../timeline/timeline.js';
|
13
18
|
import * as TimelineUtils from '../timeline/utils/utils.js';
|
14
19
|
|
20
|
+
import * as AiAgent from './AiAgent.js';
|
15
21
|
import * as Freestyler from './freestyler.js';
|
16
22
|
|
17
23
|
function getTestAidaClient() {
|
@@ -33,12 +39,16 @@ async function drainMicroTasks() {
|
|
33
39
|
}
|
34
40
|
|
35
41
|
describeWithEnvironment('FreestylerPanel', () => {
|
36
|
-
let mockView: sinon.SinonStub
|
42
|
+
let mockView: sinon.SinonStub<[Freestyler.Props, unknown, HTMLElement]>;
|
37
43
|
let panel: Freestyler.FreestylerPanel;
|
38
44
|
|
39
45
|
beforeEach(() => {
|
40
46
|
mockView = sinon.stub();
|
41
47
|
registerNoopActions(['elements.toggle-element-search']);
|
48
|
+
UI.Context.Context.instance().setFlavor(ElementsPanel.ElementsPanel.ElementsPanel, null);
|
49
|
+
UI.Context.Context.instance().setFlavor(NetworkPanel.NetworkPanel.NetworkPanel, null);
|
50
|
+
UI.Context.Context.instance().setFlavor(SourcesPanel.SourcesPanel.SourcesPanel, null);
|
51
|
+
UI.Context.Context.instance().setFlavor(TimelinePanel.TimelinePanel.TimelinePanel, null);
|
42
52
|
});
|
43
53
|
|
44
54
|
afterEach(() => {
|
@@ -309,9 +319,10 @@ describeWithEnvironment('FreestylerPanel', () => {
|
|
309
319
|
UI.Context.Context.instance().setFlavor(SDK.DOMModel.DOMNode, node);
|
310
320
|
panel.markAsRoot();
|
311
321
|
panel.show(document.body);
|
322
|
+
panel.handleAction('freestyler.elements-floating-button');
|
312
323
|
|
313
324
|
sinon.assert.calledWith(mockView, sinon.match({
|
314
|
-
|
325
|
+
selectedContext: new Freestyler.NodeContext(node),
|
315
326
|
}));
|
316
327
|
});
|
317
328
|
|
@@ -324,8 +335,9 @@ describeWithEnvironment('FreestylerPanel', () => {
|
|
324
335
|
});
|
325
336
|
panel.markAsRoot();
|
326
337
|
panel.show(document.body);
|
338
|
+
panel.handleAction('freestyler.elements-floating-button');
|
327
339
|
sinon.assert.calledWith(mockView, sinon.match({
|
328
|
-
|
340
|
+
selectedContext: null,
|
329
341
|
}));
|
330
342
|
|
331
343
|
const node = sinon.createStubInstance(SDK.DOMModel.DOMNode, {
|
@@ -334,7 +346,7 @@ describeWithEnvironment('FreestylerPanel', () => {
|
|
334
346
|
UI.Context.Context.instance().setFlavor(SDK.DOMModel.DOMNode, node);
|
335
347
|
|
336
348
|
sinon.assert.calledWith(mockView, sinon.match({
|
337
|
-
|
349
|
+
selectedContext: new Freestyler.NodeContext(node),
|
338
350
|
}));
|
339
351
|
});
|
340
352
|
|
@@ -347,8 +359,9 @@ describeWithEnvironment('FreestylerPanel', () => {
|
|
347
359
|
});
|
348
360
|
panel.markAsRoot();
|
349
361
|
panel.show(document.body);
|
362
|
+
panel.handleAction('freestyler.elements-floating-button');
|
350
363
|
sinon.assert.calledWith(mockView, sinon.match({
|
351
|
-
|
364
|
+
selectedContext: null,
|
352
365
|
}));
|
353
366
|
|
354
367
|
const node = sinon.createStubInstance(SDK.DOMModel.DOMNode, {
|
@@ -357,7 +370,7 @@ describeWithEnvironment('FreestylerPanel', () => {
|
|
357
370
|
UI.Context.Context.instance().setFlavor(SDK.DOMModel.DOMNode, node);
|
358
371
|
|
359
372
|
sinon.assert.calledWith(mockView, sinon.match({
|
360
|
-
|
373
|
+
selectedContext: null,
|
361
374
|
}));
|
362
375
|
});
|
363
376
|
|
@@ -391,9 +404,10 @@ describeWithEnvironment('FreestylerPanel', () => {
|
|
391
404
|
UI.Context.Context.instance().setFlavor(SDK.NetworkRequest.NetworkRequest, networkRequest);
|
392
405
|
panel.markAsRoot();
|
393
406
|
panel.show(document.body);
|
407
|
+
panel.handleAction('drjones.network-floating-button');
|
394
408
|
|
395
409
|
sinon.assert.calledWith(mockView, sinon.match({
|
396
|
-
|
410
|
+
selectedContext: new Freestyler.RequestContext(networkRequest),
|
397
411
|
}));
|
398
412
|
});
|
399
413
|
|
@@ -406,15 +420,16 @@ describeWithEnvironment('FreestylerPanel', () => {
|
|
406
420
|
});
|
407
421
|
panel.markAsRoot();
|
408
422
|
panel.show(document.body);
|
423
|
+
panel.handleAction('drjones.network-floating-button');
|
409
424
|
sinon.assert.calledWith(mockView, sinon.match({
|
410
|
-
|
425
|
+
selectedContext: null,
|
411
426
|
}));
|
412
427
|
|
413
428
|
const networkRequest = sinon.createStubInstance(SDK.NetworkRequest.NetworkRequest);
|
414
429
|
UI.Context.Context.instance().setFlavor(SDK.NetworkRequest.NetworkRequest, networkRequest);
|
415
430
|
|
416
431
|
sinon.assert.calledWith(mockView, sinon.match({
|
417
|
-
|
432
|
+
selectedContext: new Freestyler.RequestContext(networkRequest),
|
418
433
|
}));
|
419
434
|
});
|
420
435
|
|
@@ -446,9 +461,10 @@ describeWithEnvironment('FreestylerPanel', () => {
|
|
446
461
|
UI.Context.Context.instance().setFlavor(TimelineUtils.AICallTree.AICallTree, selectedAiCallTree);
|
447
462
|
panel.markAsRoot();
|
448
463
|
panel.show(document.body);
|
464
|
+
panel.handleAction('drjones.performance-panel-context');
|
449
465
|
|
450
466
|
sinon.assert.calledWith(mockView, sinon.match({
|
451
|
-
selectedAiCallTree,
|
467
|
+
selectedContext: new Freestyler.CallTreeContext(selectedAiCallTree as TimelineUtils.AICallTree.AICallTree),
|
452
468
|
}));
|
453
469
|
});
|
454
470
|
|
@@ -461,15 +477,16 @@ describeWithEnvironment('FreestylerPanel', () => {
|
|
461
477
|
});
|
462
478
|
panel.markAsRoot();
|
463
479
|
panel.show(document.body);
|
480
|
+
panel.handleAction('drjones.performance-panel-context');
|
464
481
|
sinon.assert.calledWith(mockView, sinon.match({
|
465
|
-
|
482
|
+
selectedContext: null,
|
466
483
|
}));
|
467
484
|
|
468
485
|
const selectedAiCallTree = {};
|
469
486
|
UI.Context.Context.instance().setFlavor(TimelineUtils.AICallTree.AICallTree, selectedAiCallTree);
|
470
487
|
|
471
488
|
sinon.assert.calledWith(mockView, sinon.match({
|
472
|
-
selectedAiCallTree,
|
489
|
+
selectedContext: new Freestyler.CallTreeContext(selectedAiCallTree as TimelineUtils.AICallTree.AICallTree),
|
473
490
|
}));
|
474
491
|
});
|
475
492
|
|
@@ -501,9 +518,10 @@ describeWithEnvironment('FreestylerPanel', () => {
|
|
501
518
|
UI.Context.Context.instance().setFlavor(Workspace.UISourceCode.UISourceCode, uiSourceCode);
|
502
519
|
panel.markAsRoot();
|
503
520
|
panel.show(document.body);
|
521
|
+
panel.handleAction('drjones.sources-panel-context');
|
504
522
|
|
505
523
|
sinon.assert.calledWith(mockView, sinon.match({
|
506
|
-
|
524
|
+
selectedContext: new Freestyler.FileContext(uiSourceCode),
|
507
525
|
}));
|
508
526
|
});
|
509
527
|
|
@@ -516,15 +534,16 @@ describeWithEnvironment('FreestylerPanel', () => {
|
|
516
534
|
});
|
517
535
|
panel.markAsRoot();
|
518
536
|
panel.show(document.body);
|
537
|
+
panel.handleAction('drjones.sources-panel-context');
|
519
538
|
sinon.assert.calledWith(mockView, sinon.match({
|
520
|
-
|
539
|
+
selectedContext: null,
|
521
540
|
}));
|
522
541
|
|
523
542
|
const uiSourceCode = sinon.createStubInstance(Workspace.UISourceCode.UISourceCode);
|
524
543
|
UI.Context.Context.instance().setFlavor(Workspace.UISourceCode.UISourceCode, uiSourceCode);
|
525
544
|
|
526
545
|
sinon.assert.calledWith(mockView, sinon.match({
|
527
|
-
|
546
|
+
selectedContext: new Freestyler.FileContext(uiSourceCode),
|
528
547
|
}));
|
529
548
|
});
|
530
549
|
|
@@ -611,17 +630,17 @@ describeWithEnvironment('FreestylerPanel', () => {
|
|
611
630
|
syncInfo: getTestSyncInfo(),
|
612
631
|
});
|
613
632
|
panel.handleAction('freestyler.elements-floating-button');
|
614
|
-
|
633
|
+
mockView.lastCall.args[0].onTextSubmit('test');
|
615
634
|
await drainMicroTasks();
|
616
635
|
|
617
|
-
assert.deepEqual(mockView.lastCall.args
|
636
|
+
assert.deepEqual(mockView.lastCall.args[0].messages, [
|
618
637
|
{
|
619
|
-
entity:
|
638
|
+
entity: Freestyler.ChatMessageEntity.USER,
|
620
639
|
text: 'test',
|
621
640
|
},
|
622
641
|
{
|
623
642
|
answer: 'test',
|
624
|
-
entity:
|
643
|
+
entity: Freestyler.ChatMessageEntity.MODEL,
|
625
644
|
rpcId: undefined,
|
626
645
|
suggestions: undefined,
|
627
646
|
steps: [],
|
@@ -631,27 +650,66 @@ describeWithEnvironment('FreestylerPanel', () => {
|
|
631
650
|
const button = toolbar!.shadowRoot!.querySelector('devtools-button[aria-label=\'New chat\']');
|
632
651
|
assert.instanceOf(button, HTMLElement);
|
633
652
|
dispatchClickEvent(button);
|
634
|
-
assert.deepEqual(mockView.lastCall.args
|
653
|
+
assert.deepEqual(mockView.lastCall.args[0].messages, []);
|
635
654
|
});
|
636
655
|
|
637
|
-
it('should
|
656
|
+
it('should select default agent after new chat', async () => {
|
657
|
+
const stub = getGetHostConfigStub({
|
658
|
+
devToolsFreestyler: {
|
659
|
+
enabled: true,
|
660
|
+
},
|
661
|
+
});
|
638
662
|
panel = new Freestyler.FreestylerPanel(mockView, {
|
639
663
|
aidaClient: getTestAidaClient(),
|
640
664
|
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
641
665
|
syncInfo: getTestSyncInfo(),
|
642
666
|
});
|
643
667
|
panel.handleAction('freestyler.elements-floating-button');
|
644
|
-
|
668
|
+
mockView.lastCall.args[0].onTextSubmit('test');
|
645
669
|
await drainMicroTasks();
|
670
|
+
UI.Context.Context.instance().setFlavor(
|
671
|
+
ElementsPanel.ElementsPanel.ElementsPanel,
|
672
|
+
sinon.createStubInstance(ElementsPanel.ElementsPanel.ElementsPanel));
|
646
673
|
|
647
|
-
assert.deepEqual(mockView.lastCall.args
|
674
|
+
assert.deepEqual(mockView.lastCall.args[0].messages, [
|
675
|
+
{
|
676
|
+
entity: Freestyler.ChatMessageEntity.USER,
|
677
|
+
text: 'test',
|
678
|
+
},
|
648
679
|
{
|
649
|
-
|
680
|
+
answer: 'test',
|
681
|
+
entity: Freestyler.ChatMessageEntity.MODEL,
|
682
|
+
rpcId: undefined,
|
683
|
+
suggestions: undefined,
|
684
|
+
steps: [],
|
685
|
+
},
|
686
|
+
]);
|
687
|
+
const toolbar = panel.contentElement.querySelector('.freestyler-left-toolbar');
|
688
|
+
const button = toolbar!.shadowRoot!.querySelector('devtools-button[aria-label=\'New chat\']');
|
689
|
+
assert.instanceOf(button, HTMLElement);
|
690
|
+
dispatchClickEvent(button);
|
691
|
+
assert.deepEqual(mockView.lastCall.args[0].messages, []);
|
692
|
+
assert.deepEqual(mockView.lastCall.args[0].agentType, AiAgent.AgentType.FREESTYLER);
|
693
|
+
stub.restore();
|
694
|
+
});
|
695
|
+
|
696
|
+
it('should switch agents and restore history', async () => {
|
697
|
+
panel = new Freestyler.FreestylerPanel(mockView, {
|
698
|
+
aidaClient: getTestAidaClient(),
|
699
|
+
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
700
|
+
syncInfo: getTestSyncInfo(),
|
701
|
+
});
|
702
|
+
panel.handleAction('freestyler.elements-floating-button');
|
703
|
+
mockView.lastCall.args[0].onTextSubmit('User question to Freestyler?');
|
704
|
+
await drainMicroTasks();
|
705
|
+
assert.deepEqual(mockView.lastCall.args[0].messages, [
|
706
|
+
{
|
707
|
+
entity: Freestyler.ChatMessageEntity.USER,
|
650
708
|
text: 'User question to Freestyler?',
|
651
709
|
},
|
652
710
|
{
|
653
711
|
answer: 'test',
|
654
|
-
entity:
|
712
|
+
entity: Freestyler.ChatMessageEntity.MODEL,
|
655
713
|
rpcId: undefined,
|
656
714
|
suggestions: undefined,
|
657
715
|
steps: [],
|
@@ -659,16 +717,16 @@ describeWithEnvironment('FreestylerPanel', () => {
|
|
659
717
|
]);
|
660
718
|
|
661
719
|
panel.handleAction('drjones.network-floating-button');
|
662
|
-
|
720
|
+
mockView.lastCall.args[0].onTextSubmit('User question to DrJones?');
|
663
721
|
await drainMicroTasks();
|
664
|
-
assert.deepEqual(mockView.lastCall.args
|
722
|
+
assert.deepEqual(mockView.lastCall.args[0].messages, [
|
665
723
|
{
|
666
|
-
entity:
|
724
|
+
entity: Freestyler.ChatMessageEntity.USER,
|
667
725
|
text: 'User question to DrJones?',
|
668
726
|
},
|
669
727
|
{
|
670
728
|
answer: 'test',
|
671
|
-
entity:
|
729
|
+
entity: Freestyler.ChatMessageEntity.MODEL,
|
672
730
|
rpcId: undefined,
|
673
731
|
suggestions: undefined,
|
674
732
|
steps: [],
|
@@ -686,14 +744,14 @@ describeWithEnvironment('FreestylerPanel', () => {
|
|
686
744
|
contextMenu.invokeHandler(freestylerEntry.id());
|
687
745
|
|
688
746
|
await drainMicroTasks();
|
689
|
-
assert.deepEqual(mockView.lastCall.args
|
747
|
+
assert.deepEqual(mockView.lastCall.args[0].messages, [
|
690
748
|
{
|
691
|
-
entity:
|
749
|
+
entity: Freestyler.ChatMessageEntity.USER,
|
692
750
|
text: 'User question to Freestyler?',
|
693
751
|
},
|
694
752
|
{
|
695
753
|
answer: 'test',
|
696
|
-
entity:
|
754
|
+
entity: Freestyler.ChatMessageEntity.MODEL,
|
697
755
|
rpcId: undefined,
|
698
756
|
suggestions: undefined,
|
699
757
|
steps: [],
|
@@ -709,27 +767,469 @@ describeWithEnvironment('FreestylerPanel', () => {
|
|
709
767
|
syncInfo: getTestSyncInfo(),
|
710
768
|
});
|
711
769
|
panel.handleAction('freestyler.elements-floating-button');
|
712
|
-
|
770
|
+
mockView.lastCall.args[0].onTextSubmit('test');
|
771
|
+
await drainMicroTasks();
|
772
|
+
|
773
|
+
assert.deepEqual(mockView.lastCall.args[0].messages, [
|
774
|
+
{
|
775
|
+
entity: Freestyler.ChatMessageEntity.USER,
|
776
|
+
text: 'test',
|
777
|
+
},
|
778
|
+
{
|
779
|
+
answer: 'test',
|
780
|
+
entity: Freestyler.ChatMessageEntity.MODEL,
|
781
|
+
rpcId: undefined,
|
782
|
+
suggestions: undefined,
|
783
|
+
steps: [],
|
784
|
+
},
|
785
|
+
]);
|
786
|
+
const toolbar = panel.contentElement.querySelector('.freestyler-left-toolbar');
|
787
|
+
const button = toolbar!.shadowRoot!.querySelector('devtools-button[aria-label=\'Delete chat\']');
|
788
|
+
assert.instanceOf(button, HTMLElement);
|
789
|
+
dispatchClickEvent(button);
|
790
|
+
assert.deepEqual(mockView.lastCall.args[0].messages, []);
|
791
|
+
assert.deepEqual(mockView.lastCall.args[0].agentType, undefined);
|
792
|
+
});
|
793
|
+
|
794
|
+
it('should select default agent based on open panel after clearing the chat', async () => {
|
795
|
+
const stub = getGetHostConfigStub({
|
796
|
+
devToolsFreestyler: {
|
797
|
+
enabled: true,
|
798
|
+
},
|
799
|
+
});
|
800
|
+
panel = new Freestyler.FreestylerPanel(mockView, {
|
801
|
+
aidaClient: getTestAidaClient(),
|
802
|
+
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
803
|
+
syncInfo: getTestSyncInfo(),
|
804
|
+
});
|
805
|
+
panel.handleAction('freestyler.elements-floating-button');
|
806
|
+
mockView.lastCall.args[0].onTextSubmit('test');
|
713
807
|
await drainMicroTasks();
|
714
808
|
|
715
|
-
|
809
|
+
UI.Context.Context.instance().setFlavor(
|
810
|
+
ElementsPanel.ElementsPanel.ElementsPanel, sinon.createStubInstance(ElementsPanel.ElementsPanel.ElementsPanel));
|
811
|
+
assert.deepEqual(mockView.lastCall.args[0].messages, [
|
716
812
|
{
|
717
|
-
entity:
|
813
|
+
entity: Freestyler.ChatMessageEntity.USER,
|
718
814
|
text: 'test',
|
719
815
|
},
|
720
816
|
{
|
721
817
|
answer: 'test',
|
722
|
-
entity:
|
818
|
+
entity: Freestyler.ChatMessageEntity.MODEL,
|
723
819
|
rpcId: undefined,
|
724
820
|
suggestions: undefined,
|
725
821
|
steps: [],
|
726
822
|
},
|
727
823
|
]);
|
728
824
|
const toolbar = panel.contentElement.querySelector('.freestyler-left-toolbar');
|
729
|
-
const button = toolbar!.shadowRoot!.querySelector('devtools-button[aria-label=\'
|
825
|
+
const button = toolbar!.shadowRoot!.querySelector('devtools-button[aria-label=\'Delete chat\']');
|
730
826
|
assert.instanceOf(button, HTMLElement);
|
731
827
|
dispatchClickEvent(button);
|
732
|
-
assert.deepEqual(mockView.lastCall.args
|
733
|
-
assert.deepEqual(mockView.lastCall.args
|
828
|
+
assert.deepEqual(mockView.lastCall.args[0].messages, []);
|
829
|
+
assert.deepEqual(mockView.lastCall.args[0].agentType, AiAgent.AgentType.FREESTYLER);
|
830
|
+
stub.restore();
|
831
|
+
});
|
832
|
+
|
833
|
+
it('should have empty state after clear chat history', async () => {
|
834
|
+
panel = new Freestyler.FreestylerPanel(mockView, {
|
835
|
+
aidaClient: getTestAidaClient(),
|
836
|
+
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
837
|
+
syncInfo: getTestSyncInfo(),
|
838
|
+
});
|
839
|
+
panel.handleAction('freestyler.elements-floating-button');
|
840
|
+
mockView.lastCall.args[0].onTextSubmit('User question to Freestyler?');
|
841
|
+
await drainMicroTasks();
|
842
|
+
assert.deepEqual(mockView.lastCall.args[0].messages, [
|
843
|
+
{
|
844
|
+
entity: Freestyler.ChatMessageEntity.USER,
|
845
|
+
text: 'User question to Freestyler?',
|
846
|
+
},
|
847
|
+
{
|
848
|
+
answer: 'test',
|
849
|
+
entity: Freestyler.ChatMessageEntity.MODEL,
|
850
|
+
rpcId: undefined,
|
851
|
+
suggestions: undefined,
|
852
|
+
steps: [],
|
853
|
+
},
|
854
|
+
]);
|
855
|
+
|
856
|
+
panel.handleAction('drjones.network-floating-button');
|
857
|
+
mockView.lastCall.args[0].onTextSubmit('User question to DrJones?');
|
858
|
+
await drainMicroTasks();
|
859
|
+
assert.deepEqual(mockView.lastCall.args[0].messages, [
|
860
|
+
{
|
861
|
+
entity: Freestyler.ChatMessageEntity.USER,
|
862
|
+
text: 'User question to DrJones?',
|
863
|
+
},
|
864
|
+
{
|
865
|
+
answer: 'test',
|
866
|
+
entity: Freestyler.ChatMessageEntity.MODEL,
|
867
|
+
rpcId: undefined,
|
868
|
+
suggestions: undefined,
|
869
|
+
steps: [],
|
870
|
+
},
|
871
|
+
]);
|
872
|
+
|
873
|
+
let toolbar = panel.contentElement.querySelector('.freestyler-left-toolbar');
|
874
|
+
let button = toolbar!.shadowRoot!.querySelector('devtools-button[aria-label=\'History\']');
|
875
|
+
assert.instanceOf(button, HTMLElement);
|
876
|
+
let contextMenu = getMenu(() => {
|
877
|
+
dispatchClickEvent(button!);
|
878
|
+
});
|
879
|
+
const clearAll = findMenuItemWithLabel(contextMenu.footerSection(), 'Clear chat history')!;
|
880
|
+
assert.isDefined(clearAll);
|
881
|
+
contextMenu.invokeHandler(clearAll.id());
|
882
|
+
await drainMicroTasks();
|
883
|
+
assert.deepEqual(mockView.lastCall.args[0].messages, []);
|
884
|
+
assert.deepEqual(mockView.lastCall.args[0].agentType, undefined);
|
885
|
+
|
886
|
+
await drainMicroTasks();
|
887
|
+
contextMenu.discard();
|
888
|
+
await drainMicroTasks();
|
889
|
+
|
890
|
+
toolbar = panel.contentElement.querySelector('.freestyler-left-toolbar');
|
891
|
+
button = toolbar!.shadowRoot!.querySelector('devtools-button[aria-label=\'History\']');
|
892
|
+
assert.instanceOf(button, HTMLElement);
|
893
|
+
contextMenu = getMenu(() => {
|
894
|
+
dispatchClickEvent(button);
|
895
|
+
});
|
896
|
+
const menuItem = findMenuItemWithLabel(contextMenu.defaultSection(), 'No past conversations');
|
897
|
+
assert(menuItem);
|
898
|
+
});
|
899
|
+
describe('cross-origin', () => {
|
900
|
+
it('blocks input on cross origin requests', async () => {
|
901
|
+
const networkRequest = sinon.createStubInstance(SDK.NetworkRequest.NetworkRequest, {
|
902
|
+
url: 'https://a.test' as Platform.DevToolsPath.UrlString,
|
903
|
+
});
|
904
|
+
UI.Context.Context.instance().setFlavor(SDK.NetworkRequest.NetworkRequest, networkRequest);
|
905
|
+
panel = new Freestyler.FreestylerPanel(mockView, {
|
906
|
+
aidaClient: getTestAidaClient(),
|
907
|
+
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
908
|
+
syncInfo: getTestSyncInfo(),
|
909
|
+
});
|
910
|
+
panel.markAsRoot();
|
911
|
+
panel.show(document.body);
|
912
|
+
panel.handleAction('drjones.network-floating-button');
|
913
|
+
|
914
|
+
sinon.assert.calledWith(mockView, sinon.match({
|
915
|
+
selectedContext: new Freestyler.RequestContext(networkRequest),
|
916
|
+
blockedByCrossOrigin: false,
|
917
|
+
}));
|
918
|
+
|
919
|
+
// Send a query for https://a.test.
|
920
|
+
panel.handleAction('drjones.network-floating-button');
|
921
|
+
mockView.lastCall.args[0].onTextSubmit('test');
|
922
|
+
await drainMicroTasks();
|
923
|
+
|
924
|
+
// Change context to https://b.test.
|
925
|
+
const networkRequest2 = sinon.createStubInstance(SDK.NetworkRequest.NetworkRequest, {
|
926
|
+
url: 'https://b.test' as Platform.DevToolsPath.UrlString,
|
927
|
+
});
|
928
|
+
UI.Context.Context.instance().setFlavor(SDK.NetworkRequest.NetworkRequest, networkRequest2);
|
929
|
+
panel.handleAction('drjones.network-floating-button');
|
930
|
+
await drainMicroTasks();
|
931
|
+
|
932
|
+
sinon.assert.calledWith(mockView, sinon.match({
|
933
|
+
selectedContext: new Freestyler.RequestContext(networkRequest2),
|
934
|
+
blockedByCrossOrigin: true,
|
935
|
+
}));
|
936
|
+
});
|
937
|
+
});
|
938
|
+
|
939
|
+
describe('auto agent selection for panels', () => {
|
940
|
+
describe('Elements panel', () => {
|
941
|
+
it('should select FREESTYLER agent when the Elements panel is open in initial render', () => {
|
942
|
+
const stub = getGetHostConfigStub({
|
943
|
+
devToolsFreestyler: {
|
944
|
+
enabled: true,
|
945
|
+
},
|
946
|
+
});
|
947
|
+
UI.Context.Context.instance().setFlavor(
|
948
|
+
ElementsPanel.ElementsPanel.ElementsPanel,
|
949
|
+
sinon.createStubInstance(ElementsPanel.ElementsPanel.ElementsPanel));
|
950
|
+
panel = new Freestyler.FreestylerPanel(mockView, {
|
951
|
+
aidaClient: getTestAidaClient(),
|
952
|
+
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
953
|
+
syncInfo: getTestSyncInfo(),
|
954
|
+
});
|
955
|
+
|
956
|
+
panel.markAsRoot();
|
957
|
+
panel.show(document.body);
|
958
|
+
|
959
|
+
sinon.assert.calledWith(mockView, sinon.match({
|
960
|
+
agentType: AiAgent.AgentType.FREESTYLER,
|
961
|
+
}));
|
962
|
+
stub.restore();
|
963
|
+
});
|
964
|
+
|
965
|
+
it('should update to no agent state when the Elements panel is closed and no other panels are open', () => {
|
966
|
+
const stub = getGetHostConfigStub({
|
967
|
+
devToolsFreestyler: {
|
968
|
+
enabled: true,
|
969
|
+
},
|
970
|
+
});
|
971
|
+
UI.Context.Context.instance().setFlavor(
|
972
|
+
ElementsPanel.ElementsPanel.ElementsPanel,
|
973
|
+
sinon.createStubInstance(ElementsPanel.ElementsPanel.ElementsPanel));
|
974
|
+
panel = new Freestyler.FreestylerPanel(mockView, {
|
975
|
+
aidaClient: getTestAidaClient(),
|
976
|
+
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
977
|
+
syncInfo: getTestSyncInfo(),
|
978
|
+
});
|
979
|
+
|
980
|
+
panel.markAsRoot();
|
981
|
+
panel.show(document.body);
|
982
|
+
sinon.assert.calledWith(mockView, sinon.match({
|
983
|
+
agentType: AiAgent.AgentType.FREESTYLER,
|
984
|
+
}));
|
985
|
+
|
986
|
+
UI.Context.Context.instance().setFlavor(ElementsPanel.ElementsPanel.ElementsPanel, null);
|
987
|
+
assert.deepStrictEqual(mockView.lastCall.args[0].agentType, undefined);
|
988
|
+
stub.restore();
|
989
|
+
});
|
990
|
+
|
991
|
+
it('should render no agent state when Elements panel is open but Freestyler is not enabled', () => {
|
992
|
+
const stub = getGetHostConfigStub({
|
993
|
+
devToolsFreestyler: {
|
994
|
+
enabled: false,
|
995
|
+
},
|
996
|
+
});
|
997
|
+
UI.Context.Context.instance().setFlavor(
|
998
|
+
ElementsPanel.ElementsPanel.ElementsPanel,
|
999
|
+
sinon.createStubInstance(ElementsPanel.ElementsPanel.ElementsPanel));
|
1000
|
+
panel = new Freestyler.FreestylerPanel(mockView, {
|
1001
|
+
aidaClient: getTestAidaClient(),
|
1002
|
+
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
1003
|
+
syncInfo: getTestSyncInfo(),
|
1004
|
+
});
|
1005
|
+
|
1006
|
+
panel.markAsRoot();
|
1007
|
+
panel.show(document.body);
|
1008
|
+
|
1009
|
+
assert.deepStrictEqual(mockView.lastCall.args[0].agentType, undefined);
|
1010
|
+
stub.restore();
|
1011
|
+
});
|
1012
|
+
});
|
1013
|
+
|
1014
|
+
describe('Network panel', () => {
|
1015
|
+
it('should select DRJONES_NETWORK agent when the Network panel is open in initial render', () => {
|
1016
|
+
const stub = getGetHostConfigStub({
|
1017
|
+
devToolsAiAssistanceNetworkAgent: {
|
1018
|
+
enabled: true,
|
1019
|
+
},
|
1020
|
+
});
|
1021
|
+
UI.Context.Context.instance().setFlavor(
|
1022
|
+
NetworkPanel.NetworkPanel.NetworkPanel, sinon.createStubInstance(NetworkPanel.NetworkPanel.NetworkPanel));
|
1023
|
+
panel = new Freestyler.FreestylerPanel(mockView, {
|
1024
|
+
aidaClient: getTestAidaClient(),
|
1025
|
+
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
1026
|
+
syncInfo: getTestSyncInfo(),
|
1027
|
+
});
|
1028
|
+
|
1029
|
+
panel.markAsRoot();
|
1030
|
+
panel.show(document.body);
|
1031
|
+
|
1032
|
+
sinon.assert.calledWith(mockView, sinon.match({
|
1033
|
+
agentType: AiAgent.AgentType.DRJONES_NETWORK_REQUEST,
|
1034
|
+
}));
|
1035
|
+
stub.restore();
|
1036
|
+
});
|
1037
|
+
|
1038
|
+
it('should update to no agent state when the Network panel is closed and no other panels are open', () => {
|
1039
|
+
const stub = getGetHostConfigStub({
|
1040
|
+
devToolsAiAssistanceNetworkAgent: {
|
1041
|
+
enabled: true,
|
1042
|
+
},
|
1043
|
+
});
|
1044
|
+
UI.Context.Context.instance().setFlavor(
|
1045
|
+
NetworkPanel.NetworkPanel.NetworkPanel, sinon.createStubInstance(NetworkPanel.NetworkPanel.NetworkPanel));
|
1046
|
+
panel = new Freestyler.FreestylerPanel(mockView, {
|
1047
|
+
aidaClient: getTestAidaClient(),
|
1048
|
+
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
1049
|
+
syncInfo: getTestSyncInfo(),
|
1050
|
+
});
|
1051
|
+
|
1052
|
+
panel.markAsRoot();
|
1053
|
+
panel.show(document.body);
|
1054
|
+
sinon.assert.calledWith(mockView, sinon.match({
|
1055
|
+
agentType: AiAgent.AgentType.DRJONES_NETWORK_REQUEST,
|
1056
|
+
}));
|
1057
|
+
|
1058
|
+
UI.Context.Context.instance().setFlavor(NetworkPanel.NetworkPanel.NetworkPanel, null);
|
1059
|
+
assert.deepStrictEqual(mockView.lastCall.args[0].agentType, undefined);
|
1060
|
+
stub.restore();
|
1061
|
+
});
|
1062
|
+
|
1063
|
+
it('should render no agent state when Network panel is open but devToolsAiAssistanceNetworkAgent is not enabled',
|
1064
|
+
() => {
|
1065
|
+
const stub = getGetHostConfigStub({
|
1066
|
+
devToolsAiAssistanceNetworkAgent: {
|
1067
|
+
enabled: false,
|
1068
|
+
},
|
1069
|
+
});
|
1070
|
+
UI.Context.Context.instance().setFlavor(
|
1071
|
+
NetworkPanel.NetworkPanel.NetworkPanel,
|
1072
|
+
sinon.createStubInstance(NetworkPanel.NetworkPanel.NetworkPanel));
|
1073
|
+
panel = new Freestyler.FreestylerPanel(mockView, {
|
1074
|
+
aidaClient: getTestAidaClient(),
|
1075
|
+
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
1076
|
+
syncInfo: getTestSyncInfo(),
|
1077
|
+
});
|
1078
|
+
|
1079
|
+
panel.markAsRoot();
|
1080
|
+
panel.show(document.body);
|
1081
|
+
|
1082
|
+
assert.deepStrictEqual(mockView.lastCall.args[0].agentType, undefined);
|
1083
|
+
stub.restore();
|
1084
|
+
});
|
1085
|
+
});
|
1086
|
+
|
1087
|
+
describe('Sources panel', () => {
|
1088
|
+
it('should select DRJONES_FILE agent when the Sources panel is open in initial render', () => {
|
1089
|
+
const stub = getGetHostConfigStub({
|
1090
|
+
devToolsAiAssistanceFileAgent: {
|
1091
|
+
enabled: true,
|
1092
|
+
},
|
1093
|
+
});
|
1094
|
+
UI.Context.Context.instance().setFlavor(
|
1095
|
+
SourcesPanel.SourcesPanel.SourcesPanel, sinon.createStubInstance(SourcesPanel.SourcesPanel.SourcesPanel));
|
1096
|
+
panel = new Freestyler.FreestylerPanel(mockView, {
|
1097
|
+
aidaClient: getTestAidaClient(),
|
1098
|
+
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
1099
|
+
syncInfo: getTestSyncInfo(),
|
1100
|
+
});
|
1101
|
+
|
1102
|
+
panel.markAsRoot();
|
1103
|
+
panel.show(document.body);
|
1104
|
+
|
1105
|
+
sinon.assert.calledWith(mockView, sinon.match({
|
1106
|
+
agentType: AiAgent.AgentType.DRJONES_FILE,
|
1107
|
+
}));
|
1108
|
+
stub.restore();
|
1109
|
+
});
|
1110
|
+
|
1111
|
+
it('should update to no agent state when the Sources panel is closed and no other panels are open', () => {
|
1112
|
+
const stub = getGetHostConfigStub({
|
1113
|
+
devToolsAiAssistanceFileAgent: {
|
1114
|
+
enabled: true,
|
1115
|
+
},
|
1116
|
+
});
|
1117
|
+
UI.Context.Context.instance().setFlavor(
|
1118
|
+
SourcesPanel.SourcesPanel.SourcesPanel, sinon.createStubInstance(SourcesPanel.SourcesPanel.SourcesPanel));
|
1119
|
+
panel = new Freestyler.FreestylerPanel(mockView, {
|
1120
|
+
aidaClient: getTestAidaClient(),
|
1121
|
+
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
1122
|
+
syncInfo: getTestSyncInfo(),
|
1123
|
+
});
|
1124
|
+
|
1125
|
+
panel.markAsRoot();
|
1126
|
+
panel.show(document.body);
|
1127
|
+
sinon.assert.calledWith(mockView, sinon.match({
|
1128
|
+
agentType: AiAgent.AgentType.DRJONES_FILE,
|
1129
|
+
}));
|
1130
|
+
|
1131
|
+
UI.Context.Context.instance().setFlavor(SourcesPanel.SourcesPanel.SourcesPanel, null);
|
1132
|
+
assert.deepStrictEqual(mockView.lastCall.args[0].agentType, undefined);
|
1133
|
+
stub.restore();
|
1134
|
+
});
|
1135
|
+
|
1136
|
+
it('should render no agent state when Sources panel is open but devToolsAiAssistanceFileAgent is not enabled',
|
1137
|
+
() => {
|
1138
|
+
const stub = getGetHostConfigStub({
|
1139
|
+
devToolsAiAssistanceFileAgent: {
|
1140
|
+
enabled: false,
|
1141
|
+
},
|
1142
|
+
});
|
1143
|
+
UI.Context.Context.instance().setFlavor(
|
1144
|
+
SourcesPanel.SourcesPanel.SourcesPanel,
|
1145
|
+
sinon.createStubInstance(SourcesPanel.SourcesPanel.SourcesPanel));
|
1146
|
+
panel = new Freestyler.FreestylerPanel(mockView, {
|
1147
|
+
aidaClient: getTestAidaClient(),
|
1148
|
+
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
1149
|
+
syncInfo: getTestSyncInfo(),
|
1150
|
+
});
|
1151
|
+
|
1152
|
+
panel.markAsRoot();
|
1153
|
+
panel.show(document.body);
|
1154
|
+
|
1155
|
+
assert.deepStrictEqual(mockView.lastCall.args[0].agentType, undefined);
|
1156
|
+
stub.restore();
|
1157
|
+
});
|
1158
|
+
});
|
1159
|
+
|
1160
|
+
describe('Performance panel', () => {
|
1161
|
+
it('should select DRJONES_PERFORMANCE agent when the Performance panel is open in initial render', () => {
|
1162
|
+
const stub = getGetHostConfigStub({
|
1163
|
+
devToolsAiAssistancePerformanceAgent: {
|
1164
|
+
enabled: true,
|
1165
|
+
},
|
1166
|
+
});
|
1167
|
+
UI.Context.Context.instance().setFlavor(
|
1168
|
+
TimelinePanel.TimelinePanel.TimelinePanel,
|
1169
|
+
sinon.createStubInstance(TimelinePanel.TimelinePanel.TimelinePanel));
|
1170
|
+
panel = new Freestyler.FreestylerPanel(mockView, {
|
1171
|
+
aidaClient: getTestAidaClient(),
|
1172
|
+
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
1173
|
+
syncInfo: getTestSyncInfo(),
|
1174
|
+
});
|
1175
|
+
|
1176
|
+
panel.markAsRoot();
|
1177
|
+
panel.show(document.body);
|
1178
|
+
|
1179
|
+
sinon.assert.calledWith(mockView, sinon.match({
|
1180
|
+
agentType: AiAgent.AgentType.DRJONES_PERFORMANCE,
|
1181
|
+
}));
|
1182
|
+
stub.restore();
|
1183
|
+
});
|
1184
|
+
|
1185
|
+
it('should update to no agent state when the Performance panel is closed and no other panels are open', () => {
|
1186
|
+
const stub = getGetHostConfigStub({
|
1187
|
+
devToolsAiAssistancePerformanceAgent: {
|
1188
|
+
enabled: true,
|
1189
|
+
},
|
1190
|
+
});
|
1191
|
+
UI.Context.Context.instance().setFlavor(
|
1192
|
+
TimelinePanel.TimelinePanel.TimelinePanel,
|
1193
|
+
sinon.createStubInstance(TimelinePanel.TimelinePanel.TimelinePanel));
|
1194
|
+
panel = new Freestyler.FreestylerPanel(mockView, {
|
1195
|
+
aidaClient: getTestAidaClient(),
|
1196
|
+
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
1197
|
+
syncInfo: getTestSyncInfo(),
|
1198
|
+
});
|
1199
|
+
|
1200
|
+
panel.markAsRoot();
|
1201
|
+
panel.show(document.body);
|
1202
|
+
sinon.assert.calledWith(mockView, sinon.match({
|
1203
|
+
agentType: AiAgent.AgentType.DRJONES_PERFORMANCE,
|
1204
|
+
}));
|
1205
|
+
|
1206
|
+
UI.Context.Context.instance().setFlavor(TimelinePanel.TimelinePanel.TimelinePanel, null);
|
1207
|
+
assert.deepStrictEqual(mockView.lastCall.args[0].agentType, undefined);
|
1208
|
+
stub.restore();
|
1209
|
+
});
|
1210
|
+
|
1211
|
+
it('should render no agent state when Performance panel is open but devToolsAiAssistancePerformanceAgent is not enabled',
|
1212
|
+
() => {
|
1213
|
+
const stub = getGetHostConfigStub({
|
1214
|
+
devToolsAiAssistancePerformanceAgent: {
|
1215
|
+
enabled: false,
|
1216
|
+
},
|
1217
|
+
});
|
1218
|
+
UI.Context.Context.instance().setFlavor(
|
1219
|
+
TimelinePanel.TimelinePanel.TimelinePanel,
|
1220
|
+
sinon.createStubInstance(TimelinePanel.TimelinePanel.TimelinePanel));
|
1221
|
+
panel = new Freestyler.FreestylerPanel(mockView, {
|
1222
|
+
aidaClient: getTestAidaClient(),
|
1223
|
+
aidaAvailability: Host.AidaClient.AidaAccessPreconditions.AVAILABLE,
|
1224
|
+
syncInfo: getTestSyncInfo(),
|
1225
|
+
});
|
1226
|
+
|
1227
|
+
panel.markAsRoot();
|
1228
|
+
panel.show(document.body);
|
1229
|
+
|
1230
|
+
assert.deepStrictEqual(mockView.lastCall.args[0].agentType, undefined);
|
1231
|
+
stub.restore();
|
1232
|
+
});
|
1233
|
+
});
|
734
1234
|
});
|
735
1235
|
});
|