a5f4b0ae1b46275bc6b6ba354fc4a581b83496bf
[WebKit-https.git] / Source / WebCore / testing / Internals.idl
1 /*
2  * Copyright (C) 2012 Google Inc. All rights reserved.
3  * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1.  Redistributions of source code must retain the above copyright
10  *     notice, this list of conditions and the following disclaimer.
11  * 2.  Redistributions in binary form must reproduce the above copyright
12  *     notice, this list of conditions and the following disclaimer in the
13  *     documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
16  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
19  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
26
27 enum PageOverlayType {
28     "view",
29     "document"
30 };
31
32 // These map to ResourceRequestCachePolicy.
33 enum CachePolicy {
34     "UseProtocolCachePolicy",
35     "ReloadIgnoringCacheData",
36     "ReturnCacheDataElseLoad",
37     "ReturnCacheDataDontLoad"
38 };
39
40 // FIXME: Strings in an enum should not have the name of the enum as a prefix.
41 enum ResourceLoadPriority {
42     "ResourceLoadPriorityVeryLow",
43     "ResourceLoadPriorityLow",
44     "ResourceLoadPriorityMedium",
45     "ResourceLoadPriorityHigh",
46     "ResourceLoadPriorityVeryHigh"
47 };
48
49 [Conditional=MEDIA_SESSION] enum MediaSessionInterruptingCategory {
50     "content",
51     "transient",
52     "transient-solo"
53 };
54
55 [Conditional=MEDIA_SESSION] enum MediaControlEvent {
56     "play-pause",
57     "next-track",
58     "previous-track"
59 };
60
61 // FIXME: Strings in an enum should not have the name of the enum as a prefix.
62 enum AutoFillButtonType {
63     "AutoFillButtonTypeNone",
64     "AutoFillButtonTypeContacts",
65     "AutoFillButtonTypeCredentials"
66 };
67
68 enum UserInterfaceLayoutDirection {
69     "LTR",
70     "RTL"
71 };
72
73 enum BaseWritingDirection {
74     "Natural",
75     "Ltr",
76     "Rtl"
77 };
78
79 enum EventThrottlingBehavior {
80     "responsive",
81     "unresponsive"
82 };
83
84 [
85     ExportMacro=WEBCORE_TESTSUPPORT_EXPORT,
86     NoInterfaceObject,
87 ] interface Internals {
88     DOMString address(Node node);
89     boolean nodeNeedsStyleRecalc(Node node);
90     DOMString styleChangeType(Node node);
91     DOMString description(any value);
92
93     // Animated image pausing testing.
94     boolean hasPausedImageAnimations(Element element);
95
96     [MayThrowException] DOMString elementRenderTreeAsText(Element element);
97     boolean isPreloaded(DOMString url);
98     boolean isLoadingFromMemoryCache(DOMString url);
99     DOMString fetchResponseSource(FetchResponse response);
100     DOMString xhrResponseSource(XMLHttpRequest xhr);
101     boolean isSharingStyleSheetContents(HTMLLinkElement a, HTMLLinkElement b);
102     boolean isStyleSheetLoadingSubresources(HTMLLinkElement link);
103     void clearMemoryCache();
104     void pruneMemoryCacheToSize(long size);
105     void destroyDecodedDataForAllImages();
106     long memoryCacheSize();
107     void setOverrideCachePolicy(CachePolicy policy);
108     void setOverrideResourceLoadPriority(ResourceLoadPriority priority);
109     void setStrictRawResourceValidationPolicyDisabled(boolean disabled);
110
111     void clearPageCache();
112     unsigned long pageCacheSize();
113
114     CSSStyleDeclaration computedStyleIncludingVisitedInfo(Element element);
115
116     Node ensureUserAgentShadowRoot(Element host);
117     Node shadowRoot(Element host);
118
119     // CSS Deferred Parsing Testing.
120     long deferredStyleRulesCount(StyleSheet sheet);
121     long deferredGroupRulesCount(StyleSheet sheet);
122     long deferredKeyframesRulesCount(StyleSheet sheet);
123
124     [MayThrowException] DOMString shadowRootType(Node root);
125     DOMString shadowPseudoId(Element element);
126     void setShadowPseudoId(Element element, DOMString id);
127     Node treeScopeRootNode(Node node);
128     Node parentTreeScope(Node node);
129
130     // Spatial Navigation testing
131     [MayThrowException] unsigned long lastSpatialNavigationCandidateCount();
132
133     // CSS Animation testing.
134     unsigned long numberOfActiveAnimations();
135     [MayThrowException] void suspendAnimations();
136     [MayThrowException] void resumeAnimations();
137     [MayThrowException] boolean animationsAreSuspended();
138     [MayThrowException] boolean pauseAnimationAtTimeOnElement(DOMString animationName, unrestricted double pauseTime, Element element);
139     [MayThrowException] boolean pauseAnimationAtTimeOnPseudoElement(DOMString animationName, unrestricted double pauseTime, Element element, DOMString pseudoId);
140     readonly attribute double animationsInterval;
141
142     // CSS Transition testing.
143     [MayThrowException] boolean pauseTransitionAtTimeOnElement(DOMString propertyName, unrestricted double pauseTime, Element element);
144     [MayThrowException] boolean pauseTransitionAtTimeOnPseudoElement(DOMString property, unrestricted double pauseTime, Element element, DOMString pseudoId);
145
146     DOMString visiblePlaceholder(Element element);
147     void selectColorInColorChooser(HTMLInputElement element, DOMString colorValue);
148     [MayThrowException] sequence<DOMString> formControlStateOfPreviousHistoryItem();
149     [MayThrowException] void setFormControlStateOfPreviousHistoryItem(sequence<DOMString> values);
150
151     [MayThrowException] DOMRect absoluteCaretBounds();
152
153     DOMRect boundingBox(Element element);
154
155     [MayThrowException] DOMRectList inspectorHighlightRects();
156     [MayThrowException] DOMString inspectorHighlightObject();
157
158     [MayThrowException] unsigned long markerCountForNode(Node node, DOMString markerType);
159     [MayThrowException] Range? markerRangeForNode(Node node, DOMString markerType, unsigned long index);
160     [MayThrowException] DOMString markerDescriptionForNode(Node node, DOMString markerType, unsigned long index);
161     [MayThrowException] DOMString dumpMarkerRects(DOMString markerType);
162     void addTextMatchMarker(Range range, boolean isActive);
163     [MayThrowException] void setMarkedTextMatchesAreHighlighted(boolean flag);
164
165     void invalidateFontCache();
166     void setFontSmoothingEnabled(boolean enabled);
167
168     [MayThrowException] void setScrollViewPosition(long x, long y);
169
170     // Like Element.scrollTo(), but without constaints, for testing rubber-banding.
171     [MayThrowException] void unconstrainedScrollTo(Element element, unrestricted double x, unrestricted double y);
172
173     [MayThrowException] DOMRect layoutViewportRect();
174     [MayThrowException] DOMRect visualViewportRect();
175
176     [MayThrowException] void setViewBaseBackgroundColor(DOMString colorValue);
177
178     [MayThrowException] void setPagination(DOMString mode, long gap, optional long pageLength = 0);
179     [MayThrowException] void setPaginationLineGridEnabled(boolean enabled);
180
181     [MayThrowException] DOMString configurationForViewport(unrestricted float devicePixelRatio, long deviceWidth, long deviceHeight, long availableWidth, long availableHeight);
182
183     [MayThrowException] boolean wasLastChangeUserEdit(Element textField);
184     boolean elementShouldAutoComplete(HTMLInputElement inputElement);
185     void setEditingValue(HTMLInputElement inputElement, DOMString value);
186     void setAutofilled(HTMLInputElement inputElement, boolean enabled);
187     void setShowAutoFillButton(HTMLInputElement inputElement, AutoFillButtonType autoFillButtonType);
188
189     [MayThrowException] Range? rangeOfString(DOMString text, Range? referenceRange, sequence<DOMString> findOptions);
190     [MayThrowException] unsigned long countMatchesForText(DOMString text, sequence<DOMString> findOptions, DOMString markMatches);
191     [MayThrowException] unsigned long countFindMatches(DOMString text, sequence<DOMString> findOptions);
192
193     [MayThrowException] DOMString autofillFieldName(Element formControlElement);
194
195     [MayThrowException] void paintControlTints();
196
197     [MayThrowException] void scrollElementToRect(Element element, long x, long y, long w, long h);
198
199     Range? rangeFromLocationAndLength(Element scope, long rangeLocation, long rangeLength);
200     unsigned long locationFromRange(Element scope, Range range);
201     unsigned long lengthFromRange(Element scope, Range range);
202     DOMString rangeAsText(Range range);
203     Range subrange(Range range, long rangeLocation, long rangeLength);
204     [MayThrowException] Range? rangeForDictionaryLookupAtLocation(long x, long y);
205     Range? rangeOfStringNearLocation(Range range, DOMString text, long targetOffset);
206
207     [MayThrowException] void setDelegatesScrolling(boolean enabled);
208
209     [MayThrowException] long lastSpellCheckRequestSequence();
210     [MayThrowException] long lastSpellCheckProcessedSequence();
211
212     sequence<DOMString> userPreferredLanguages();
213     void setUserPreferredLanguages(sequence<DOMString> languages);
214
215     sequence<DOMString> userPreferredAudioCharacteristics();
216     void setUserPreferredAudioCharacteristic(DOMString characteristic);
217
218     [MayThrowException] unsigned long wheelEventHandlerCount();
219     [MayThrowException] unsigned long touchEventHandlerCount();
220
221     [MayThrowException] DOMRectList touchEventRectsForEvent(DOMString eventName);
222     [MayThrowException] DOMRectList passiveTouchEventListenerRects();
223
224     [MayThrowException] NodeList? nodesFromRect(Document document, long x, long y,
225         unsigned long topPadding, unsigned long rightPadding, unsigned long bottomPadding, unsigned long leftPadding,
226         boolean ignoreClipping, boolean allowShadowContent, boolean allowChildFrameContent);
227
228     // Calling parserMetaData() with no arguments gets the metadata for the script of the current scope.
229     DOMString parserMetaData(optional any func);
230
231     void updateEditorUINowIfScheduled();
232
233     boolean hasSpellingMarker(long from, long length);
234     boolean hasGrammarMarker(long from, long length);
235     boolean hasAutocorrectedMarker(long from, long length);
236     void setContinuousSpellCheckingEnabled(boolean enabled);
237     void setAutomaticQuoteSubstitutionEnabled(boolean enabled);
238     void setAutomaticLinkDetectionEnabled(boolean enabled);
239     void setAutomaticDashSubstitutionEnabled(boolean enabled);
240     void setAutomaticTextReplacementEnabled(boolean enabled);
241     void setAutomaticSpellingCorrectionEnabled(boolean enabled);
242
243     void handleAcceptedCandidate(DOMString candidate, unsigned long location, unsigned long length);
244
245     boolean isOverwriteModeEnabled();
246     void toggleOverwriteModeEnabled();
247
248     unsigned long numberOfScrollableAreas();
249
250     [MayThrowException] boolean isPageBoxVisible(long pageNumber);
251
252     unsigned long imageFrameIndex(HTMLImageElement element);
253     void setImageFrameDecodingDuration(HTMLImageElement element, unrestricted float duration);
254     void resetImageAnimation(HTMLImageElement element);
255     boolean isImageAnimating(HTMLImageElement element);
256     void setClearDecoderAfterAsyncFrameRequestForTesting(HTMLImageElement element, boolean enabled);
257     unsigned long imageDecodeCount(HTMLImageElement element);
258     void setLargeImageAsyncDecodingEnabledForTesting(HTMLImageElement element, boolean enabled);
259
260     void setGridMaxTracksLimit(unsigned long maxTracksLimit);
261
262     readonly attribute InternalSettings settings;
263     readonly attribute unsigned long workerThreadCount;
264
265     [MayThrowException] readonly attribute boolean areSVGAnimationsPaused;
266     [MayThrowException] double svgAnimationsInterval(SVGSVGElement element);
267
268     // Flags for layerTreeAsText.
269     const unsigned short LAYER_TREE_INCLUDES_VISIBLE_RECTS = 1;
270     const unsigned short LAYER_TREE_INCLUDES_TILE_CACHES = 2;
271     const unsigned short LAYER_TREE_INCLUDES_REPAINT_RECTS = 4;
272     const unsigned short LAYER_TREE_INCLUDES_PAINTING_PHASES = 8;
273     const unsigned short LAYER_TREE_INCLUDES_CONTENT_LAYERS = 16;
274     const unsigned short LAYER_TREE_INCLUDES_ACCELERATES_DRAWING = 32;
275     const unsigned short LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED = 64;
276     [MayThrowException] DOMString layerTreeAsText(Document document, optional unsigned short flags = 0);
277
278     [MayThrowException] unsigned long long layerIDForElement(Element element);
279
280     [MayThrowException] DOMString scrollingStateTreeAsText();
281     [MayThrowException] DOMString mainThreadScrollingReasons(); // FIXME: rename to synchronousScrollingReasons().
282     [MayThrowException] DOMRectList nonFastScrollableRects();
283
284     [MayThrowException] DOMString repaintRectsAsText();
285
286     // These throw if the element does not have a compositing layer.
287     [MayThrowException] void setElementUsesDisplayListDrawing(Element element, boolean usesDisplayListDrawing);
288     [MayThrowException] void setElementTracksDisplayListReplay(Element element, boolean trackReplay);
289
290     // Flags for displayListForElement.
291     const unsigned short DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1;
292     // Returns the recorded display list.
293     [MayThrowException] DOMString displayListForElement(Element element, optional unsigned short flags = 0);
294     // Returns the display list that was actually painted.
295     [MayThrowException] DOMString replayDisplayListForElement(Element element, optional unsigned short flags = 0);
296
297     [MayThrowException] void garbageCollectDocumentResources();
298
299     [MayThrowException] void insertAuthorCSS(DOMString css);
300     [MayThrowException] void insertUserCSS(DOMString css);
301
302     readonly attribute boolean isUnderMemoryPressure;
303     void beginSimulatedMemoryPressure();
304     void endSimulatedMemoryPressure();
305
306     unsigned long numberOfLiveNodes();
307     unsigned long numberOfLiveDocuments();
308     unsigned long referencingNodeCount(Document document);
309     DOMWindow? openDummyInspectorFrontend(DOMString url);
310     void closeDummyInspectorFrontend();
311     [MayThrowException] void setInspectorIsUnderTest(boolean isUnderTest);
312
313     DOMString counterValue(Element element);
314     long pageNumber(Element element, optional unrestricted float pageWidth = 800, optional unrestricted float pageHeight = 600);
315     sequence<DOMString> shortcutIconURLs();
316     long numberOfPages(optional unrestricted double pageWidthInPixels = 800, optional unrestricted double pageHeightInPixels = 600);
317     [MayThrowException] DOMString pageProperty(DOMString propertyName, long pageNumber);
318     [MayThrowException] DOMString pageSizeAndMarginsInPixels(long pageIndex, long width, long height, long marginTop, long marginRight, long marginBottom, long marginLeft);
319
320     [MayThrowException] void setPageScaleFactor(unrestricted float scaleFactor, long x, long y);
321     [MayThrowException] float pageScaleFactor();
322
323     [MayThrowException] void setPageZoomFactor(unrestricted float zoomFactor);
324     [MayThrowException] void setTextZoomFactor(unrestricted float zoomFactor);
325
326     [MayThrowException] void setUseFixedLayout(boolean useFixedLayout);
327     [MayThrowException] void setFixedLayoutSize(long width, long height);
328     void setPrinting(long width, long height);
329
330     [MayThrowException] void setViewExposedRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
331
332     void setHeaderHeight(unrestricted float height);
333     void setFooterHeight(unrestricted float height);
334
335     void setTopContentInset(unrestricted float contentInset);
336
337     [Conditional=FULLSCREEN_API] void webkitWillEnterFullScreenForElement(Element element);
338     [Conditional=FULLSCREEN_API] void webkitDidEnterFullScreenForElement(Element element);
339     [Conditional=FULLSCREEN_API] void webkitWillExitFullScreenForElement(Element element);
340     [Conditional=FULLSCREEN_API] void webkitDidExitFullScreenForElement(Element element);
341
342     void setApplicationCacheOriginQuota(unsigned long long quota);
343
344     void registerURLSchemeAsBypassingContentSecurityPolicy(DOMString scheme);
345     void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(DOMString scheme);
346
347     void registerDefaultPortForProtocol(unsigned short port, DOMString scheme);
348
349     MallocStatistics mallocStatistics();
350     TypeConversions typeConversions();
351     MemoryInfo memoryInfo();
352
353     sequence<DOMString> getReferencedFilePaths();
354
355     // These functions both reset the tracked repaint rects. They are intended to be used in the following order:
356     //  startTrackingRepaints, repaintRectsAsText, stopTrackingRepaints.
357     [MayThrowException] void startTrackingRepaints();
358     [MayThrowException] void stopTrackingRepaints();
359
360     [MayThrowException] void startTrackingLayerFlushes();
361     [MayThrowException] unsigned long layerFlushCount();
362
363     // Query if a timer is currently throttled, to debug timer throttling.
364     [MayThrowException] boolean isTimerThrottled(long timerHandle);
365
366     boolean isRequestAnimationFrameThrottled();
367     boolean areTimersThrottled();
368
369     [MayThrowException] void setLowPowerModeEnabled(boolean enabled);
370     readonly attribute double requestAnimationFrameInterval;
371     readonly attribute boolean scriptedAnimationsAreSuspended;
372
373     // Override the behavior of WebPage::eventThrottlingDelay(), which only affects iOS.
374     attribute EventThrottlingBehavior? eventThrottlingBehaviorOverride;
375
376     [MayThrowException] void startTrackingStyleRecalcs();
377     [MayThrowException] unsigned long styleRecalcCount();
378     readonly attribute unsigned long lastStyleUpdateSize;
379
380     [MayThrowException] void startTrackingCompositingUpdates();
381     [MayThrowException] unsigned long compositingUpdateCount();
382
383     // |node| should be Document, HTMLIFrameElement, or unspecified.
384     // If |node| is an HTMLIFrameElement, it assumes node.contentDocument is
385     // specified without security checks. Unspecified or null means this document.
386     [MayThrowException] void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(optional Node? node = null);
387
388     readonly attribute unsigned long layoutCount;
389
390     // Returns a string with information about the mouse cursor used at the specified client location.
391     [MayThrowException] DOMString getCurrentCursorInfo();
392
393     DOMString markerTextForListItem(Element element);
394
395     DOMString toolTipFromElement(Element element);
396
397     SerializedScriptValue deserializeBuffer(ArrayBuffer buffer);
398     ArrayBuffer serializeObject(SerializedScriptValue object);
399
400     boolean isFromCurrentWorld(any obj);
401
402     void setUsesOverlayScrollbars(boolean enabled);
403     void setUsesMockScrollAnimator(boolean enabled);
404
405     void forceReload(boolean endToEnd);
406     void reloadExpiredOnly();
407
408     void enableAutoSizeMode(boolean enabled, long minimumWidth, long minimumHeight, long maximumWidth, long maximumHeight);
409
410     [Conditional=VIDEO] sequence<DOMString> mediaResponseSources(HTMLMediaElement media);
411     [Conditional=VIDEO] sequence<DOMString> mediaResponseContentRanges(HTMLMediaElement media);
412     [Conditional=VIDEO] void simulateAudioInterruption(HTMLMediaElement element);
413     [Conditional=VIDEO, MayThrowException] boolean mediaElementHasCharacteristic(HTMLMediaElement element, DOMString characteristic);
414
415     [Conditional=LEGACY_ENCRYPTED_MEDIA] void initializeMockCDM();
416     [Conditional=ENCRYPTED_MEDIA] MockCDMFactory registerMockCDM();
417
418     [Conditional=SPEECH_SYNTHESIS] void enableMockSpeechSynthesizer();
419
420     DOMString getImageSourceURL(Element element);
421
422     [Conditional=VIDEO_TRACK, MayThrowException] DOMString captionsStyleSheetOverride();
423     [Conditional=VIDEO_TRACK, MayThrowException] void setCaptionsStyleSheetOverride(DOMString override);
424     [Conditional=VIDEO_TRACK, MayThrowException] void setPrimaryAudioTrackLanguageOverride(DOMString language);
425     [Conditional=VIDEO_TRACK, MayThrowException] void setCaptionDisplayMode(DOMString mode);
426
427     [Conditional=VIDEO] TimeRanges createTimeRanges(Float32Array startTimes, Float32Array
428      endTimes);
429     [Conditional=VIDEO] unrestricted double closestTimeToTimeRanges(unrestricted double time, TimeRanges ranges);
430
431     boolean isSelectPopupVisible(HTMLSelectElement element);
432
433     [MayThrowException] boolean isPluginUnavailabilityIndicatorObscured(Element element);
434     boolean isPluginSnapshotted(Element element);
435
436     [MayThrowException] DOMRect selectionBounds();
437
438     [Conditional=MEDIA_SOURCE] void initializeMockMediaSource();
439     [Conditional=MEDIA_SOURCE] sequence<DOMString> bufferedSamplesForTrackID(SourceBuffer buffer, DOMString trackID);
440     [Conditional=MEDIA_SOURCE] sequence<DOMString> enqueuedSamplesForTrackID(SourceBuffer buffer, DOMString trackID);
441     [Conditional=MEDIA_SOURCE] void setShouldGenerateTimestamps(SourceBuffer buffer, boolean flag);
442
443     [Conditional=VIDEO, MayThrowException] void beginMediaSessionInterruption(DOMString interruptionType);
444     [Conditional=VIDEO] void endMediaSessionInterruption(DOMString flags);
445     [Conditional=MEDIA_SESSION] void sendMediaSessionStartOfInterruptionNotification(MediaSessionInterruptingCategory category);
446     [Conditional=MEDIA_SESSION] void sendMediaSessionEndOfInterruptionNotification(MediaSessionInterruptingCategory category);
447     [Conditional=MEDIA_SESSION] DOMString mediaSessionCurrentState(MediaSession session);
448     [Conditional=MEDIA_SESSION] double mediaElementPlayerVolume(HTMLMediaElement element);
449     [Conditional=MEDIA_SESSION] void sendMediaControlEvent(MediaControlEvent event);
450     [Conditional=VIDEO] void applicationWillBecomeInactive();
451     [Conditional=VIDEO] void applicationDidBecomeActive();
452     [Conditional=VIDEO] void applicationWillEnterForeground(optional boolean suspendedUnderLock = false);
453     [Conditional=VIDEO] void applicationDidEnterBackground(optional boolean suspendedUnderLock = false);
454     [Conditional=VIDEO, MayThrowException] void setMediaSessionRestrictions(DOMString mediaType, DOMString restrictions);
455     [Conditional=VIDEO, MayThrowException] DOMString mediaSessionRestrictions(DOMString mediaType);
456     [Conditional=VIDEO] void setMediaElementRestrictions(HTMLMediaElement element, DOMString restrictions);
457     [Conditional=WEB_AUDIO] void setAudioContextRestrictions(AudioContext context, DOMString restrictions);
458     [Conditional=VIDEO, MayThrowException] void postRemoteControlCommand(DOMString command, optional unrestricted float argument = 0);
459     [Conditional=WIRELESS_PLAYBACK_TARGET] void setMockMediaPlaybackTargetPickerEnabled(boolean enabled);
460     [Conditional=WIRELESS_PLAYBACK_TARGET, MayThrowException] void setMockMediaPlaybackTargetPickerState(DOMString deviceName, DOMString deviceState);
461     [Conditional=MEDIA_STREAM] void setMockMediaCaptureDevicesEnabled(boolean enabled);
462
463     [Conditional=WEB_RTC] void emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection connection, DOMString action);
464     [Conditional=WEB_RTC] void useMockRTCPeerConnectionFactory(DOMString testCase);
465     [Conditional=WEB_RTC] void setICECandidateFiltering(boolean enabled);
466     [Conditional=WEB_RTC] void setEnumeratingAllNetworkInterfacesEnabled(boolean enabled);
467     [Conditional=WEB_RTC] void stopPeerConnection(RTCPeerConnection connection);
468
469     [Conditional=VIDEO] void simulateSystemSleep();
470     [Conditional=VIDEO] void simulateSystemWake();
471     [Conditional=VIDEO] boolean elementIsBlockingDisplaySleep(HTMLMediaElement element);
472
473     [MayThrowException] MockPageOverlay installMockPageOverlay(PageOverlayType type);
474     [MayThrowException] DOMString pageOverlayLayerTreeAsText(optional unsigned short flags = 0);
475
476     void setPageMuted(DOMString mutedState);
477     DOMString pageMediaState();
478
479     void setPageDefersLoading(boolean defersLoading);
480
481     File? createFile(DOMString url);
482     void queueMicroTask(long testNumber);
483     boolean testPreloaderSettingViewport();
484
485     [Conditional=CONTENT_FILTERING] readonly attribute MockContentFilterSettings mockContentFilterSettings;
486
487     [Conditional=CSS_SCROLL_SNAP, MayThrowException] DOMString scrollSnapOffsets(Element element);
488     [Conditional=CSS_SCROLL_SNAP] void setPlatformMomentumScrollingPredictionEnabled(boolean enabled);
489
490     [MayThrowException] DOMString pathStringWithShrinkWrappedRects(sequence<double> rectComponents, double radius);
491
492     [Conditional=VIDEO] DOMString getCurrentMediaControlsStatusForElement(HTMLMediaElement element);
493
494     DOMString userVisibleString(DOMURL url);
495
496     void setShowAllPlugins(boolean showAll);
497
498     [Conditional=STREAMS_API, CallWith=ScriptState] any cloneArrayBuffer(any buffer, any srcByteOffset, any byteLength);
499     [Conditional=STREAMS_API, CallWith=ScriptState] boolean isReadableStreamDisturbed(any stream);
500
501     DOMString resourceLoadStatisticsForOrigin(DOMString domain);
502     void setResourceLoadStatisticsEnabled(boolean enable);
503     [EnabledBySetting=StorageAccessAPI] void setUserGrantsStorageAccess(boolean value);
504
505     [MayThrowException] void setCanShowModalDialogOverride(boolean allow);
506
507     DOMString composedTreeAsText(Node parent);
508
509     boolean isProcessingUserGesture();
510     double lastHandledUserGestureTimestamp();
511
512     GCObservation? observeGC(any observed);
513
514     void setUserInterfaceLayoutDirection(UserInterfaceLayoutDirection userInterfaceLayoutDirection);
515     void setBaseWritingDirection(BaseWritingDirection direction);
516
517     boolean userPrefersReducedMotion();
518     
519     void reportBacktrace();
520
521     [Conditional=POINTER_LOCK] boolean pageHasPendingPointerLock();
522     [Conditional=POINTER_LOCK] boolean pageHasPointerLock();
523
524     sequence<DOMString> accessKeyModifiers();
525
526     void setQuickLookPassword(DOMString password);
527
528     [CallWith=Document] void setAsRunningUserScripts();
529
530     void disableTileSizeUpdateDelay();
531     void setSpeculativeTilingDelayDisabledForTesting(boolean disabled);
532
533     [Conditional=WEBGL] void simulateWebGLContextChanged(WebGLRenderingContext context);
534     [Conditional=WEBGL] void failNextGPUStatusCheck(WebGLRenderingContext context);
535
536     void setPageVisibility(boolean isVisible);
537
538     [Conditional=WEB_RTC] void setH264HardwareEncoderAllowed(boolean allowed);
539     [Conditional=WEB_RTC] void applyRotationForOutgoingVideoSources(RTCPeerConnection connection);
540
541     [Conditional=MEDIA_STREAM] void setCameraMediaStreamTrackOrientation(MediaStreamTrack track, short orientation);
542     [Conditional=MEDIA_STREAM] void observeMediaStreamTrack(MediaStreamTrack track);
543     [Conditional=MEDIA_STREAM] Promise<ImageData> grabNextMediaStreamTrackFrame();
544     [Conditional=MEDIA_STREAM] readonly attribute unsigned long trackAudioSampleCount;
545     [Conditional=MEDIA_STREAM] readonly attribute unsigned long trackVideoSampleCount;
546     [Conditional=MEDIA_STREAM, MayThrowException] void setMediaDeviceState(DOMString deviceID, DOMString property, boolean value);
547     [Conditional=MEDIA_STREAM] void delayMediaStreamTrackSamples(MediaStreamTrack track, float delay);
548     [Conditional=MEDIA_STREAM] void setMediaStreamTrackMuted(MediaStreamTrack track, boolean muted);
549     [Conditional=MEDIA_STREAM] void removeMediaStreamTrack(MediaStream stream, MediaStreamTrack track);
550     [Conditional=MEDIA_STREAM] void simulateMediaStreamTrackCaptureSourceFailure(MediaStreamTrack track);
551
552     Promise<void> clearCacheStorageMemoryRepresentation();
553     Promise<DOMString> cacheStorageEngineRepresentation();
554     void setResponseSizeWithPadding(FetchResponse response, unsigned long long size);
555     unsigned long long responseSizeWithPadding(FetchResponse response);
556
557     void setConsoleMessageListener(StringCallback callback);
558
559     DOMString audioSessionCategory();
560
561     [Conditional=SERVICE_WORKER] Promise<Response> waitForFetchEventToFinish(FetchEvent event);
562     [Conditional=SERVICE_WORKER] Promise<void> waitForExtendableEventToFinish(ExtendableEvent event);
563     [Conditional=SERVICE_WORKER, CallWith=ScriptExecutionContext] FetchEvent createBeingDispatchedFetchEvent();
564     [Conditional=SERVICE_WORKER] ExtendableEvent createTrustedExtendableEvent();
565     [Conditional=SERVICE_WORKER] Promise<boolean> hasServiceWorkerRegistration(DOMString scopeURL);
566
567     boolean hasServiceWorkerRegisteredForOrigin(DOMString origin);
568
569     [EnabledAtRuntime=WebAnimations] DOMString timelineDescription(AnimationTimeline timeline);
570     [EnabledAtRuntime=WebAnimations] void pauseTimeline(AnimationTimeline timeline);
571     [EnabledAtRuntime=WebAnimations] void setTimelineCurrentTime(AnimationTimeline timeline, double currentTime);
572     [Conditional=APPLE_PAY] readonly attribute MockPaymentCoordinator mockPaymentCoordinator;
573 };