ff5a29ac15a481bdfddb39762ca25bdd73fa92e6
[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 xhrResponseSource(XMLHttpRequest xhr);
100     boolean isSharingStyleSheetContents(HTMLLinkElement a, HTMLLinkElement b);
101     boolean isStyleSheetLoadingSubresources(HTMLLinkElement link);
102     void clearMemoryCache();
103     void pruneMemoryCacheToSize(long size);
104     void destroyDecodedDataForAllImages();
105     long memoryCacheSize();
106     void setOverrideCachePolicy(CachePolicy policy);
107     void setOverrideResourceLoadPriority(ResourceLoadPriority priority);
108     void setStrictRawResourceValidationPolicyDisabled(boolean disabled);
109
110     void clearPageCache();
111     unsigned long pageCacheSize();
112
113     CSSStyleDeclaration computedStyleIncludingVisitedInfo(Element element);
114
115     Node ensureUserAgentShadowRoot(Element host);
116     Node shadowRoot(Element host);
117
118     // CSS Deferred Parsing Testing.
119     long deferredStyleRulesCount(StyleSheet sheet);
120     long deferredGroupRulesCount(StyleSheet sheet);
121     long deferredKeyframesRulesCount(StyleSheet sheet);
122
123     [MayThrowException] DOMString shadowRootType(Node root);
124     DOMString shadowPseudoId(Element element);
125     void setShadowPseudoId(Element element, DOMString id);
126     Node treeScopeRootNode(Node node);
127     Node parentTreeScope(Node node);
128
129     // Spatial Navigation testing
130     [MayThrowException] unsigned long lastSpatialNavigationCandidateCount();
131
132     // CSS Animation testing.
133     unsigned long numberOfActiveAnimations();
134     [MayThrowException] void suspendAnimations();
135     [MayThrowException] void resumeAnimations();
136     [MayThrowException] boolean animationsAreSuspended();
137     [MayThrowException] boolean pauseAnimationAtTimeOnElement(DOMString animationName, unrestricted double pauseTime, Element element);
138     [MayThrowException] boolean pauseAnimationAtTimeOnPseudoElement(DOMString animationName, unrestricted double pauseTime, Element element, DOMString pseudoId);
139     readonly attribute double animationsInterval;
140
141     // CSS Transition testing.
142     [MayThrowException] boolean pauseTransitionAtTimeOnElement(DOMString propertyName, unrestricted double pauseTime, Element element);
143     [MayThrowException] boolean pauseTransitionAtTimeOnPseudoElement(DOMString property, unrestricted double pauseTime, Element element, DOMString pseudoId);
144
145     DOMString visiblePlaceholder(Element element);
146     void selectColorInColorChooser(HTMLInputElement element, DOMString colorValue);
147     [MayThrowException] sequence<DOMString> formControlStateOfPreviousHistoryItem();
148     [MayThrowException] void setFormControlStateOfPreviousHistoryItem(sequence<DOMString> values);
149
150     [MayThrowException] DOMRect absoluteCaretBounds();
151
152     DOMRect boundingBox(Element element);
153
154     [MayThrowException] DOMRectList inspectorHighlightRects();
155     [MayThrowException] DOMString inspectorHighlightObject();
156
157     [MayThrowException] unsigned long markerCountForNode(Node node, DOMString markerType);
158     [MayThrowException] Range? markerRangeForNode(Node node, DOMString markerType, unsigned long index);
159     [MayThrowException] DOMString markerDescriptionForNode(Node node, DOMString markerType, unsigned long index);
160     [MayThrowException] DOMString dumpMarkerRects(DOMString markerType);
161     void addTextMatchMarker(Range range, boolean isActive);
162     [MayThrowException] void setMarkedTextMatchesAreHighlighted(boolean flag);
163
164     void invalidateFontCache();
165     void setFontSmoothingEnabled(boolean enabled);
166
167     [MayThrowException] void setScrollViewPosition(long x, long y);
168
169     [MayThrowException] DOMRect layoutViewportRect();
170     [MayThrowException] DOMRect visualViewportRect();
171
172     [MayThrowException] void setViewBaseBackgroundColor(DOMString colorValue);
173
174     [MayThrowException] void setPagination(DOMString mode, long gap, optional long pageLength = 0);
175     [MayThrowException] void setPaginationLineGridEnabled(boolean enabled);
176
177     [MayThrowException] DOMString configurationForViewport(unrestricted float devicePixelRatio, long deviceWidth, long deviceHeight, long availableWidth, long availableHeight);
178
179     [MayThrowException] boolean wasLastChangeUserEdit(Element textField);
180     boolean elementShouldAutoComplete(HTMLInputElement inputElement);
181     void setEditingValue(HTMLInputElement inputElement, DOMString value);
182     void setAutofilled(HTMLInputElement inputElement, boolean enabled);
183     void setShowAutoFillButton(HTMLInputElement inputElement, AutoFillButtonType autoFillButtonType);
184
185     [MayThrowException] Range? rangeOfString(DOMString text, Range? referenceRange, sequence<DOMString> findOptions);
186     [MayThrowException] unsigned long countMatchesForText(DOMString text, sequence<DOMString> findOptions, DOMString markMatches);
187     [MayThrowException] unsigned long countFindMatches(DOMString text, sequence<DOMString> findOptions);
188
189     [MayThrowException] DOMString autofillFieldName(Element formControlElement);
190
191     [MayThrowException] void paintControlTints();
192
193     [MayThrowException] void scrollElementToRect(Element element, long x, long y, long w, long h);
194
195     Range? rangeFromLocationAndLength(Element scope, long rangeLocation, long rangeLength);
196     unsigned long locationFromRange(Element scope, Range range);
197     unsigned long lengthFromRange(Element scope, Range range);
198     DOMString rangeAsText(Range range);
199     Range subrange(Range range, long rangeLocation, long rangeLength);
200     [MayThrowException] Range? rangeForDictionaryLookupAtLocation(long x, long y);
201     Range? rangeOfStringNearLocation(Range range, DOMString text, long targetOffset);
202
203     [MayThrowException] void setDelegatesScrolling(boolean enabled);
204
205     [MayThrowException] long lastSpellCheckRequestSequence();
206     [MayThrowException] long lastSpellCheckProcessedSequence();
207
208     sequence<DOMString> userPreferredLanguages();
209     void setUserPreferredLanguages(sequence<DOMString> languages);
210
211     sequence<DOMString> userPreferredAudioCharacteristics();
212     void setUserPreferredAudioCharacteristic(DOMString characteristic);
213
214     [MayThrowException] unsigned long wheelEventHandlerCount();
215     [MayThrowException] unsigned long touchEventHandlerCount();
216
217     [MayThrowException] DOMRectList touchEventRectsForEvent(DOMString eventName);
218     [MayThrowException] DOMRectList passiveTouchEventListenerRects();
219
220     [MayThrowException] NodeList? nodesFromRect(Document document, long x, long y,
221         unsigned long topPadding, unsigned long rightPadding, unsigned long bottomPadding, unsigned long leftPadding,
222         boolean ignoreClipping, boolean allowShadowContent, boolean allowChildFrameContent);
223
224     // Calling parserMetaData() with no arguments gets the metadata for the script of the current scope.
225     DOMString parserMetaData(optional any func);
226
227     void updateEditorUINowIfScheduled();
228
229     boolean hasSpellingMarker(long from, long length);
230     boolean hasGrammarMarker(long from, long length);
231     boolean hasAutocorrectedMarker(long from, long length);
232     void setContinuousSpellCheckingEnabled(boolean enabled);
233     void setAutomaticQuoteSubstitutionEnabled(boolean enabled);
234     void setAutomaticLinkDetectionEnabled(boolean enabled);
235     void setAutomaticDashSubstitutionEnabled(boolean enabled);
236     void setAutomaticTextReplacementEnabled(boolean enabled);
237     void setAutomaticSpellingCorrectionEnabled(boolean enabled);
238
239     void handleAcceptedCandidate(DOMString candidate, unsigned long location, unsigned long length);
240
241     boolean isOverwriteModeEnabled();
242     void toggleOverwriteModeEnabled();
243
244     unsigned long numberOfScrollableAreas();
245
246     [MayThrowException] boolean isPageBoxVisible(long pageNumber);
247
248     unsigned long imageFrameIndex(HTMLImageElement element);
249     void setImageFrameDecodingDuration(HTMLImageElement element, unrestricted float duration);
250     void resetImageAnimation(HTMLImageElement element);
251     boolean isImageAnimating(HTMLImageElement element);
252     void setClearDecoderAfterAsyncFrameRequestForTesting(HTMLImageElement element, boolean enabled);
253     unsigned long imageDecodeCount(HTMLImageElement element);
254     void setLargeImageAsyncDecodingEnabledForTesting(HTMLImageElement element, boolean enabled);
255
256     void setGridMaxTracksLimit(unsigned long maxTracksLimit);
257
258     readonly attribute InternalSettings settings;
259     readonly attribute unsigned long workerThreadCount;
260
261     [MayThrowException] readonly attribute boolean areSVGAnimationsPaused;
262     [MayThrowException] double svgAnimationsInterval(SVGSVGElement element);
263
264     // Flags for layerTreeAsText.
265     const unsigned short LAYER_TREE_INCLUDES_VISIBLE_RECTS = 1;
266     const unsigned short LAYER_TREE_INCLUDES_TILE_CACHES = 2;
267     const unsigned short LAYER_TREE_INCLUDES_REPAINT_RECTS = 4;
268     const unsigned short LAYER_TREE_INCLUDES_PAINTING_PHASES = 8;
269     const unsigned short LAYER_TREE_INCLUDES_CONTENT_LAYERS = 16;
270     const unsigned short LAYER_TREE_INCLUDES_ACCELERATES_DRAWING = 32;
271     const unsigned short LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED = 64;
272     [MayThrowException] DOMString layerTreeAsText(Document document, optional unsigned short flags = 0);
273
274     [MayThrowException] unsigned long long layerIDForElement(Element element);
275
276     [MayThrowException] DOMString scrollingStateTreeAsText();
277     [MayThrowException] DOMString mainThreadScrollingReasons(); // FIXME: rename to synchronousScrollingReasons().
278     [MayThrowException] DOMRectList nonFastScrollableRects();
279
280     [MayThrowException] DOMString repaintRectsAsText();
281
282     // These throw if the element does not have a compositing layer.
283     [MayThrowException] void setElementUsesDisplayListDrawing(Element element, boolean usesDisplayListDrawing);
284     [MayThrowException] void setElementTracksDisplayListReplay(Element element, boolean trackReplay);
285
286     // Flags for displayListForElement.
287     const unsigned short DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1;
288     // Returns the recorded display list.
289     [MayThrowException] DOMString displayListForElement(Element element, optional unsigned short flags = 0);
290     // Returns the display list that was actually painted.
291     [MayThrowException] DOMString replayDisplayListForElement(Element element, optional unsigned short flags = 0);
292
293     [MayThrowException] void garbageCollectDocumentResources();
294
295     [MayThrowException] void insertAuthorCSS(DOMString css);
296     [MayThrowException] void insertUserCSS(DOMString css);
297
298     readonly attribute boolean isUnderMemoryPressure;
299     void beginSimulatedMemoryPressure();
300     void endSimulatedMemoryPressure();
301
302     unsigned long numberOfLiveNodes();
303     unsigned long numberOfLiveDocuments();
304     unsigned long referencingNodeCount(Document document);
305     DOMWindow? openDummyInspectorFrontend(DOMString url);
306     void closeDummyInspectorFrontend();
307     [MayThrowException] void setInspectorIsUnderTest(boolean isUnderTest);
308
309     DOMString counterValue(Element element);
310     long pageNumber(Element element, optional unrestricted float pageWidth = 800, optional unrestricted float pageHeight = 600);
311     sequence<DOMString> shortcutIconURLs();
312     long numberOfPages(optional unrestricted double pageWidthInPixels = 800, optional unrestricted double pageHeightInPixels = 600);
313     [MayThrowException] DOMString pageProperty(DOMString propertyName, long pageNumber);
314     [MayThrowException] DOMString pageSizeAndMarginsInPixels(long pageIndex, long width, long height, long marginTop, long marginRight, long marginBottom, long marginLeft);
315
316     [MayThrowException] void setPageScaleFactor(unrestricted float scaleFactor, long x, long y);
317     [MayThrowException] float pageScaleFactor();
318
319     [MayThrowException] void setPageZoomFactor(unrestricted float zoomFactor);
320     [MayThrowException] void setTextZoomFactor(unrestricted float zoomFactor);
321
322     [MayThrowException] void setUseFixedLayout(boolean useFixedLayout);
323     [MayThrowException] void setFixedLayoutSize(long width, long height);
324     void setPrinting(long width, long height);
325
326     [MayThrowException] void setViewExposedRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height);
327
328     void setHeaderHeight(unrestricted float height);
329     void setFooterHeight(unrestricted float height);
330
331     void setTopContentInset(unrestricted float contentInset);
332
333     [Conditional=FULLSCREEN_API] void webkitWillEnterFullScreenForElement(Element element);
334     [Conditional=FULLSCREEN_API] void webkitDidEnterFullScreenForElement(Element element);
335     [Conditional=FULLSCREEN_API] void webkitWillExitFullScreenForElement(Element element);
336     [Conditional=FULLSCREEN_API] void webkitDidExitFullScreenForElement(Element element);
337
338     void setApplicationCacheOriginQuota(unsigned long long quota);
339
340     void registerURLSchemeAsBypassingContentSecurityPolicy(DOMString scheme);
341     void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(DOMString scheme);
342
343     void registerDefaultPortForProtocol(unsigned short port, DOMString scheme);
344
345     MallocStatistics mallocStatistics();
346     TypeConversions typeConversions();
347     MemoryInfo memoryInfo();
348
349     sequence<DOMString> getReferencedFilePaths();
350
351     // These functions both reset the tracked repaint rects. They are intended to be used in the following order:
352     //  startTrackingRepaints, repaintRectsAsText, stopTrackingRepaints.
353     [MayThrowException] void startTrackingRepaints();
354     [MayThrowException] void stopTrackingRepaints();
355
356     [MayThrowException] void startTrackingLayerFlushes();
357     [MayThrowException] unsigned long layerFlushCount();
358
359     // Query if a timer is currently throttled, to debug timer throttling.
360     [MayThrowException] boolean isTimerThrottled(long timerHandle);
361
362     boolean isRequestAnimationFrameThrottled();
363     boolean areTimersThrottled();
364
365     [MayThrowException] void setLowPowerModeEnabled(boolean enabled);
366     readonly attribute double requestAnimationFrameInterval;
367     readonly attribute boolean scriptedAnimationsAreSuspended;
368
369     // Override the behavior of WebPage::eventThrottlingDelay(), which only affects iOS.
370     attribute EventThrottlingBehavior? eventThrottlingBehaviorOverride;
371
372     [MayThrowException] void startTrackingStyleRecalcs();
373     [MayThrowException] unsigned long styleRecalcCount();
374     readonly attribute unsigned long lastStyleUpdateSize;
375
376     [MayThrowException] void startTrackingCompositingUpdates();
377     [MayThrowException] unsigned long compositingUpdateCount();
378
379     // |node| should be Document, HTMLIFrameElement, or unspecified.
380     // If |node| is an HTMLIFrameElement, it assumes node.contentDocument is
381     // specified without security checks. Unspecified or null means this document.
382     [MayThrowException] void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(optional Node? node = null);
383
384     readonly attribute unsigned long layoutCount;
385
386     // Returns a string with information about the mouse cursor used at the specified client location.
387     [MayThrowException] DOMString getCurrentCursorInfo();
388
389     DOMString markerTextForListItem(Element element);
390
391     DOMString toolTipFromElement(Element element);
392
393     SerializedScriptValue deserializeBuffer(ArrayBuffer buffer);
394     ArrayBuffer serializeObject(SerializedScriptValue object);
395
396     boolean isFromCurrentWorld(any obj);
397
398     void setUsesOverlayScrollbars(boolean enabled);
399     void setUsesMockScrollAnimator(boolean enabled);
400
401     void forceReload(boolean endToEnd);
402     void reloadExpiredOnly();
403
404     void enableAutoSizeMode(boolean enabled, long minimumWidth, long minimumHeight, long maximumWidth, long maximumHeight);
405
406     [Conditional=VIDEO] sequence<DOMString> mediaResponseSources(HTMLMediaElement media);
407     [Conditional=VIDEO] sequence<DOMString> mediaResponseContentRanges(HTMLMediaElement media);
408     [Conditional=VIDEO] void simulateAudioInterruption(HTMLMediaElement element);
409     [Conditional=VIDEO, MayThrowException] boolean mediaElementHasCharacteristic(HTMLMediaElement element, DOMString characteristic);
410
411     [Conditional=LEGACY_ENCRYPTED_MEDIA] void initializeMockCDM();
412     [Conditional=ENCRYPTED_MEDIA] MockCDMFactory registerMockCDM();
413
414     [Conditional=SPEECH_SYNTHESIS] void enableMockSpeechSynthesizer();
415
416     DOMString getImageSourceURL(Element element);
417
418     [Conditional=VIDEO_TRACK, MayThrowException] DOMString captionsStyleSheetOverride();
419     [Conditional=VIDEO_TRACK, MayThrowException] void setCaptionsStyleSheetOverride(DOMString override);
420     [Conditional=VIDEO_TRACK, MayThrowException] void setPrimaryAudioTrackLanguageOverride(DOMString language);
421     [Conditional=VIDEO_TRACK, MayThrowException] void setCaptionDisplayMode(DOMString mode);
422
423     [Conditional=VIDEO] TimeRanges createTimeRanges(Float32Array startTimes, Float32Array
424      endTimes);
425     [Conditional=VIDEO] unrestricted double closestTimeToTimeRanges(unrestricted double time, TimeRanges ranges);
426
427     boolean isSelectPopupVisible(HTMLSelectElement element);
428
429     [MayThrowException] boolean isPluginUnavailabilityIndicatorObscured(Element element);
430     boolean isPluginSnapshotted(Element element);
431
432     [MayThrowException] DOMRect selectionBounds();
433
434     [Conditional=MEDIA_SOURCE] void initializeMockMediaSource();
435     [Conditional=MEDIA_SOURCE] sequence<DOMString> bufferedSamplesForTrackID(SourceBuffer buffer, DOMString trackID);
436     [Conditional=MEDIA_SOURCE] sequence<DOMString> enqueuedSamplesForTrackID(SourceBuffer buffer, DOMString trackID);
437     [Conditional=MEDIA_SOURCE] void setShouldGenerateTimestamps(SourceBuffer buffer, boolean flag);
438
439     [Conditional=VIDEO, MayThrowException] void beginMediaSessionInterruption(DOMString interruptionType);
440     [Conditional=VIDEO] void endMediaSessionInterruption(DOMString flags);
441     [Conditional=MEDIA_SESSION] void sendMediaSessionStartOfInterruptionNotification(MediaSessionInterruptingCategory category);
442     [Conditional=MEDIA_SESSION] void sendMediaSessionEndOfInterruptionNotification(MediaSessionInterruptingCategory category);
443     [Conditional=MEDIA_SESSION] DOMString mediaSessionCurrentState(MediaSession session);
444     [Conditional=MEDIA_SESSION] double mediaElementPlayerVolume(HTMLMediaElement element);
445     [Conditional=MEDIA_SESSION] void sendMediaControlEvent(MediaControlEvent event);
446     [Conditional=VIDEO] void applicationWillBecomeInactive();
447     [Conditional=VIDEO] void applicationDidBecomeActive();
448     [Conditional=VIDEO] void applicationWillEnterForeground(optional boolean suspendedUnderLock = false);
449     [Conditional=VIDEO] void applicationDidEnterBackground(optional boolean suspendedUnderLock = false);
450     [Conditional=VIDEO, MayThrowException] void setMediaSessionRestrictions(DOMString mediaType, DOMString restrictions);
451     [Conditional=VIDEO, MayThrowException] DOMString mediaSessionRestrictions(DOMString mediaType);
452     [Conditional=VIDEO] void setMediaElementRestrictions(HTMLMediaElement element, DOMString restrictions);
453     [Conditional=WEB_AUDIO] void setAudioContextRestrictions(AudioContext context, DOMString restrictions);
454     [Conditional=VIDEO, MayThrowException] void postRemoteControlCommand(DOMString command, optional unrestricted float argument = 0);
455     [Conditional=WIRELESS_PLAYBACK_TARGET] void setMockMediaPlaybackTargetPickerEnabled(boolean enabled);
456     [Conditional=WIRELESS_PLAYBACK_TARGET, MayThrowException] void setMockMediaPlaybackTargetPickerState(DOMString deviceName, DOMString deviceState);
457     [Conditional=MEDIA_STREAM] void setMockMediaCaptureDevicesEnabled(boolean enabled);
458
459     [Conditional=WEB_RTC] void emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection connection, DOMString action);
460     [Conditional=WEB_RTC] void useMockRTCPeerConnectionFactory(DOMString testCase);
461     [Conditional=WEB_RTC] void setICECandidateFiltering(boolean enabled);
462     [Conditional=WEB_RTC] void setEnumeratingAllNetworkInterfacesEnabled(boolean enabled);
463     [Conditional=WEB_RTC] void stopPeerConnection(RTCPeerConnection connection);
464
465     [Conditional=VIDEO] void simulateSystemSleep();
466     [Conditional=VIDEO] void simulateSystemWake();
467     [Conditional=VIDEO] boolean elementIsBlockingDisplaySleep(HTMLMediaElement element);
468
469     [MayThrowException] MockPageOverlay installMockPageOverlay(PageOverlayType type);
470     [MayThrowException] DOMString pageOverlayLayerTreeAsText(optional unsigned short flags = 0);
471
472     void setPageMuted(DOMString mutedState);
473     DOMString pageMediaState();
474
475     void setPageDefersLoading(boolean defersLoading);
476
477     File? createFile(DOMString url);
478     void queueMicroTask(long testNumber);
479     boolean testPreloaderSettingViewport();
480
481     [Conditional=CONTENT_FILTERING] readonly attribute MockContentFilterSettings mockContentFilterSettings;
482
483     [Conditional=CSS_SCROLL_SNAP, MayThrowException] DOMString scrollSnapOffsets(Element element);
484     [Conditional=CSS_SCROLL_SNAP] void setPlatformMomentumScrollingPredictionEnabled(boolean enabled);
485
486     [MayThrowException] DOMString pathStringWithShrinkWrappedRects(sequence<double> rectComponents, double radius);
487
488     [Conditional=VIDEO] DOMString getCurrentMediaControlsStatusForElement(HTMLMediaElement element);
489
490     DOMString userVisibleString(DOMURL url);
491
492     void setShowAllPlugins(boolean showAll);
493
494     [Conditional=STREAMS_API, CallWith=ScriptState] any cloneArrayBuffer(any buffer, any srcByteOffset, any byteLength);
495     [Conditional=STREAMS_API, CallWith=ScriptState] boolean isReadableStreamDisturbed(any stream);
496
497     DOMString resourceLoadStatisticsForOrigin(DOMString domain);
498     void setResourceLoadStatisticsEnabled(boolean enable);
499
500     [MayThrowException] void setCanShowModalDialogOverride(boolean allow);
501
502     DOMString composedTreeAsText(Node parent);
503
504     boolean isProcessingUserGesture();
505     double lastHandledUserGestureTimestamp();
506
507     GCObservation? observeGC(any observed);
508
509     void setUserInterfaceLayoutDirection(UserInterfaceLayoutDirection userInterfaceLayoutDirection);
510     void setBaseWritingDirection(BaseWritingDirection direction);
511
512     boolean userPrefersReducedMotion();
513     
514     void reportBacktrace();
515
516     [Conditional=POINTER_LOCK] boolean pageHasPendingPointerLock();
517     [Conditional=POINTER_LOCK] boolean pageHasPointerLock();
518
519     sequence<DOMString> accessKeyModifiers();
520
521     void setQuickLookPassword(DOMString password);
522
523     [CallWith=Document] void setAsRunningUserScripts();
524
525     void disableTileSizeUpdateDelay();
526     void setSpeculativeTilingDelayDisabledForTesting(boolean disabled);
527
528     [Conditional=WEBGL] void simulateWebGLContextChanged(WebGLRenderingContext context);
529     [Conditional=WEBGL] void failNextGPUStatusCheck(WebGLRenderingContext context);
530
531     void setPageVisibility(boolean isVisible);
532
533     [Conditional=WEB_RTC] void setH264HardwareEncoderAllowed(boolean allowed);
534     [Conditional=WEB_RTC] void applyRotationForOutgoingVideoSources(RTCPeerConnection connection);
535
536     [Conditional=MEDIA_STREAM] void setCameraMediaStreamTrackOrientation(MediaStreamTrack track, short orientation);
537     [Conditional=MEDIA_STREAM] void observeMediaStreamTrack(MediaStreamTrack track);
538     [Conditional=MEDIA_STREAM] Promise<ImageData> grabNextMediaStreamTrackFrame();
539     [Conditional=MEDIA_STREAM] readonly attribute unsigned long trackAudioSampleCount;
540     [Conditional=MEDIA_STREAM] readonly attribute unsigned long trackVideoSampleCount;
541     [Conditional=MEDIA_STREAM, MayThrowException] void setMediaDeviceState(DOMString deviceID, DOMString property, boolean value);
542     [Conditional=MEDIA_STREAM] void delayMediaStreamTrackSamples(MediaStreamTrack track, float delay);
543     [Conditional=MEDIA_STREAM] void setMediaStreamTrackMuted(MediaStreamTrack track, boolean muted);
544     [Conditional=MEDIA_STREAM] void removeMediaStreamTrack(MediaStream stream, MediaStreamTrack track);
545     [Conditional=MEDIA_STREAM] void simulateMediaStreamTrackCaptureSourceFailure(MediaStreamTrack track);
546
547     Promise<void> clearCacheStorageMemoryRepresentation();
548     Promise<DOMString> cacheStorageEngineRepresentation();
549
550     DOMString audioSessionCategory();
551 };