REGRESSION (r230843): Flash doesn't work; Produces blue box on page
[WebKit.git] / Tools / WebKitTestRunner / TestController.h
1 /*
2  * Copyright (C) 2010, 2015-2017 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #ifndef TestController_h
27 #define TestController_h
28
29 #include "GeolocationProviderMock.h"
30 #include "WebNotificationProvider.h"
31 #include "WorkQueueManager.h"
32 #include <WebKit/WKRetainPtr.h>
33 #include <set>
34 #include <string>
35 #include <vector>
36 #include <wtf/HashMap.h>
37 #include <wtf/Vector.h>
38 #include <wtf/text/StringHash.h>
39
40 OBJC_CLASS WKWebViewConfiguration;
41
42 namespace WTR {
43
44 class TestInvocation;
45 class OriginSettings;
46 class PlatformWebView;
47 class EventSenderProxy;
48 struct TestCommand;
49 struct TestOptions;
50
51 // FIXME: Rename this TestRunner?
52 class TestController {
53 public:
54     static TestController& singleton();
55
56     static const unsigned viewWidth;
57     static const unsigned viewHeight;
58
59     static const unsigned w3cSVGViewWidth;
60     static const unsigned w3cSVGViewHeight;
61
62     static const double defaultShortTimeout;
63     static const double noTimeout;
64
65     TestController(int argc, const char* argv[]);
66     ~TestController();
67
68     bool verbose() const { return m_verbose; }
69
70     WKStringRef injectedBundlePath() const { return m_injectedBundlePath.get(); }
71     WKStringRef testPluginDirectory() const { return m_testPluginDirectory.get(); }
72
73     PlatformWebView* mainWebView() { return m_mainWebView.get(); }
74     WKContextRef context() { return m_context.get(); }
75
76     EventSenderProxy* eventSenderProxy() { return m_eventSenderProxy.get(); }
77
78     bool shouldUseRemoteLayerTree() const { return m_shouldUseRemoteLayerTree; }
79     
80     // Runs the run loop until `done` is true or the timeout elapses.
81     bool useWaitToDumpWatchdogTimer() { return m_useWaitToDumpWatchdogTimer; }
82     void runUntil(bool& done, double timeoutSeconds);
83     void notifyDone();
84
85     bool shouldShowWebView() const { return m_shouldShowWebView; }
86     bool usingServerMode() const { return m_usingServerMode; }
87     void configureViewForTest(const TestInvocation&);
88     
89     bool shouldShowTouches() const { return m_shouldShowTouches; }
90     
91     bool beforeUnloadReturnValue() const { return m_beforeUnloadReturnValue; }
92     void setBeforeUnloadReturnValue(bool value) { m_beforeUnloadReturnValue = value; }
93
94     void simulateWebNotificationClick(uint64_t notificationID);
95
96     // Geolocation.
97     void setGeolocationPermission(bool);
98     void setMockGeolocationPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, bool providesFloorLevel, double floorLevel);
99     void setMockGeolocationPositionUnavailableError(WKStringRef errorMessage);
100     void handleGeolocationPermissionRequest(WKGeolocationPermissionRequestRef);
101     bool isGeolocationProviderActive() const;
102
103     // MediaStream.
104     String saltForOrigin(WKFrameRef, String);
105     void getUserMediaInfoForOrigin(WKFrameRef, WKStringRef originKey, bool&, WKRetainPtr<WKStringRef>&);
106     WKStringRef getUserMediaSaltForOrigin(WKFrameRef, WKStringRef originKey);
107     void setUserMediaPermission(bool);
108     void resetUserMediaPermission();
109     void setUserMediaPersistentPermissionForOrigin(bool, WKStringRef userMediaDocumentOriginString, WKStringRef topLevelDocumentOriginString);
110     void handleUserMediaPermissionRequest(WKFrameRef, WKSecurityOriginRef, WKSecurityOriginRef, WKUserMediaPermissionRequestRef);
111     void handleCheckOfUserMediaPermissionForOrigin(WKFrameRef, WKSecurityOriginRef, WKSecurityOriginRef, const WKUserMediaPermissionCheckRef&);
112     OriginSettings& settingsForOrigin(const String&);
113     unsigned userMediaPermissionRequestCountForOrigin(WKStringRef userMediaDocumentOriginString, WKStringRef topLevelDocumentOriginString);
114     void resetUserMediaPermissionRequestCountForOrigin(WKStringRef userMediaDocumentOriginString, WKStringRef topLevelDocumentOriginString);
115
116     // Policy delegate.
117     void setCustomPolicyDelegate(bool enabled, bool permissive);
118
119     // Page Visibility.
120     void setHidden(bool);
121
122     unsigned imageCountInGeneralPasteboard() const;
123
124     bool resetStateToConsistentValues(const TestOptions&);
125     void resetPreferencesToConsistentValues(const TestOptions&);
126
127     void terminateWebContentProcess();
128     void reattachPageToWebProcess();
129
130     static const char* webProcessName();
131     static const char* networkProcessName();
132     static const char* databaseProcessName();
133
134     WorkQueueManager& workQueueManager() { return m_workQueueManager; }
135
136     void setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(bool value) { m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges = value; }
137     void setHandlesAuthenticationChallenges(bool value) { m_handlesAuthenticationChallenges = value; }
138     void setAuthenticationUsername(String username) { m_authenticationUsername = username; }
139     void setAuthenticationPassword(String password) { m_authenticationPassword = password; }
140     void setAllowsAnySSLCertificate(bool);
141
142     void setBlockAllPlugins(bool shouldBlock);
143     void setPluginSupportedMode(const String&);
144
145     void setShouldLogHistoryClientCallbacks(bool shouldLog) { m_shouldLogHistoryClientCallbacks = shouldLog; }
146     void setShouldLogCanAuthenticateAgainstProtectionSpace(bool shouldLog) { m_shouldLogCanAuthenticateAgainstProtectionSpace = shouldLog; }
147     void setShouldLogDownloadCallbacks(bool shouldLog) { m_shouldLogDownloadCallbacks = shouldLog; }
148
149     bool isCurrentInvocation(TestInvocation* invocation) const { return invocation == m_currentInvocation.get(); }
150
151     void setShouldDecideNavigationPolicyAfterDelay(bool value) { m_shouldDecideNavigationPolicyAfterDelay = value; }
152     void setShouldDecideResponsePolicyAfterDelay(bool value) { m_shouldDecideResponsePolicyAfterDelay = value; }
153
154     void setNavigationGesturesEnabled(bool value);
155     void setIgnoresViewportScaleLimits(bool);
156
157     void setShouldDownloadUndisplayableMIMETypes(bool value) { m_shouldDownloadUndisplayableMIMETypes = value; }
158
159     void setStatisticsLastSeen(WKStringRef hostName, double seconds);
160     void setStatisticsPrevalentResource(WKStringRef hostName, bool value);
161     void setStatisticsVeryPrevalentResource(WKStringRef hostName, bool value);
162     bool isStatisticsPrevalentResource(WKStringRef hostName);
163     bool isStatisticsVeryPrevalentResource(WKStringRef hostName);
164     bool isStatisticsRegisteredAsSubFrameUnder(WKStringRef subFrameHost, WKStringRef topFrameHost);
165     bool isStatisticsRegisteredAsRedirectingTo(WKStringRef hostRedirectedFrom, WKStringRef hostRedirectedTo);
166     void setStatisticsHasHadUserInteraction(WKStringRef hostName, bool value);
167     void setStatisticsHasHadNonRecentUserInteraction(WKStringRef hostName);
168     bool isStatisticsHasHadUserInteraction(WKStringRef hostName);
169     void setStatisticsGrandfathered(WKStringRef hostName, bool value);
170     bool isStatisticsGrandfathered(WKStringRef hostName);
171     void setStatisticsSubframeUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName);
172     void setStatisticsSubresourceUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName);
173     void setStatisticsSubresourceUniqueRedirectTo(WKStringRef hostName, WKStringRef hostNameRedirectedTo);
174     void setStatisticsSubresourceUniqueRedirectFrom(WKStringRef host, WKStringRef hostRedirectedFrom);
175     void setStatisticsTopFrameUniqueRedirectTo(WKStringRef host, WKStringRef hostRedirectedTo);
176     void setStatisticsTopFrameUniqueRedirectFrom(WKStringRef host, WKStringRef hostRedirectedFrom);
177     void setStatisticsTimeToLiveUserInteraction(double seconds);
178     void setStatisticsTimeToLiveCookiePartitionFree(double seconds);
179     void statisticsProcessStatisticsAndDataRecords();
180     void statisticsUpdateCookiePartitioning();
181     void statisticsSetShouldPartitionCookiesForHost(WKStringRef hostName, bool value);
182     void statisticsSubmitTelemetry();
183     void setStatisticsNotifyPagesWhenDataRecordsWereScanned(bool);
184     void setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval(bool);
185     void setStatisticsNotifyPagesWhenTelemetryWasCaptured(bool value);
186     void setStatisticsMinimumTimeBetweenDataRecordsRemoval(double);
187     void setStatisticsGrandfatheringTime(double seconds);
188     void setStatisticsMaxStatisticsEntries(unsigned);
189     void setStatisticsPruneEntriesDownTo(unsigned);
190     void statisticsClearInMemoryAndPersistentStore();
191     void statisticsClearInMemoryAndPersistentStoreModifiedSinceHours(unsigned);
192     void statisticsClearThroughWebsiteDataRemoval();
193     void statisticsResetToConsistentState();
194
195     void getAllStorageAccessEntries();
196
197     WKArrayRef openPanelFileURLs() const { return m_openPanelFileURLs.get(); }
198     void setOpenPanelFileURLs(WKArrayRef fileURLs) { m_openPanelFileURLs = fileURLs; }
199
200     void terminateNetworkProcess();
201     void terminateServiceWorkerProcess();
202     void terminateStorageProcess();
203
204     void removeAllSessionCredentials();
205
206     void clearServiceWorkerRegistrations();
207
208     void clearDOMCache(WKStringRef origin);
209     void clearDOMCaches();
210     bool hasDOMCache(WKStringRef origin);
211     uint64_t domCacheSize(WKStringRef origin);
212
213     bool didReceiveServerRedirectForProvisionalNavigation() const { return m_didReceiveServerRedirectForProvisionalNavigation; }
214     void clearDidReceiveServerRedirectForProvisionalNavigation() { m_didReceiveServerRedirectForProvisionalNavigation = false; }
215
216     void addMockMediaDevice(WKStringRef persistentID, WKStringRef label, WKStringRef type);
217     void clearMockMediaDevices();
218     void removeMockMediaDevice(WKStringRef persistentID);
219     void resetMockMediaDevices();
220
221 private:
222     WKRetainPtr<WKPageConfigurationRef> generatePageConfiguration(WKContextConfigurationRef);
223     WKRetainPtr<WKContextConfigurationRef> generateContextConfiguration() const;
224     void initialize(int argc, const char* argv[]);
225     void createWebViewWithOptions(const TestOptions&);
226     void run();
227
228     void runTestingServerLoop();
229     bool runTest(const char* pathOrURL);
230
231     void platformInitialize();
232     void platformDestroy();
233     WKContextRef platformAdjustContext(WKContextRef, WKContextConfigurationRef);
234     void platformInitializeContext();
235     void platformAddTestOptions(TestOptions&) const;
236     void platformCreateWebView(WKPageConfigurationRef, const TestOptions&);
237     static PlatformWebView* platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef, const TestOptions&);
238     void platformResetPreferencesToConsistentValues();
239     void platformResetStateToConsistentValues();
240 #if PLATFORM(COCOA)
241     void cocoaPlatformInitialize();
242     void cocoaResetStateToConsistentValues();
243 #endif
244     void platformConfigureViewForTest(const TestInvocation&);
245     void platformWillRunTest(const TestInvocation&);
246     void platformRunUntil(bool& done, double timeout);
247     void platformDidCommitLoadForFrame(WKPageRef, WKFrameRef);
248     WKContextRef platformContext();
249     WKPreferencesRef platformPreferences();
250     void initializeInjectedBundlePath();
251     void initializeTestPluginDirectory();
252
253     void ensureViewSupportsOptionsForTest(const TestInvocation&);
254     TestOptions testOptionsForTest(const TestCommand&) const;
255     void updatePlatformSpecificTestOptionsForTest(TestOptions&, const std::string& pathOrURL) const;
256
257     void updateWebViewSizeForTest(const TestInvocation&);
258     void updateWindowScaleForTest(PlatformWebView*, const TestInvocation&);
259
260     void decidePolicyForGeolocationPermissionRequestIfPossible();
261     void decidePolicyForUserMediaPermissionRequestIfPossible();
262
263     // WKContextInjectedBundleClient
264     static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, const void*);
265     static void didReceiveSynchronousMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void*);
266     static WKTypeRef getInjectedBundleInitializationUserData(WKContextRef, const void *clientInfo);
267
268     // WKPageInjectedBundleClient
269     static void didReceivePageMessageFromInjectedBundle(WKPageRef, WKStringRef messageName, WKTypeRef messageBody, const void*);
270     static void didReceiveSynchronousPageMessageFromInjectedBundle(WKPageRef, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void*);
271     void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
272     WKRetainPtr<WKTypeRef> didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
273     WKRetainPtr<WKTypeRef> getInjectedBundleInitializationUserData();
274
275     void didReceiveKeyDownMessageFromInjectedBundle(WKDictionaryRef messageBodyDictionary, bool synchronous);
276
277     // WKContextClient
278     static void networkProcessDidCrash(WKContextRef, const void*);
279     void networkProcessDidCrash();
280     static void databaseProcessDidCrash(WKContextRef, const void*);
281     void databaseProcessDidCrash();
282
283     // WKPageNavigationClient
284     static void didCommitNavigation(WKPageRef, WKNavigationRef, WKTypeRef userData, const void*);
285     void didCommitNavigation(WKPageRef, WKNavigationRef);
286
287     static void didFinishNavigation(WKPageRef, WKNavigationRef, WKTypeRef userData, const void*);
288     void didFinishNavigation(WKPageRef, WKNavigationRef);
289
290     
291     // WKContextDownloadClient
292     static void downloadDidStart(WKContextRef, WKDownloadRef, const void*);
293     void downloadDidStart(WKContextRef, WKDownloadRef);
294     static WKStringRef decideDestinationWithSuggestedFilename(WKContextRef, WKDownloadRef, WKStringRef filename, bool* allowOverwrite, const void *clientInfo);
295     WKStringRef decideDestinationWithSuggestedFilename(WKContextRef, WKDownloadRef, WKStringRef filename, bool*& allowOverwrite);
296     static void downloadDidFinish(WKContextRef, WKDownloadRef, const void*);
297     void downloadDidFinish(WKContextRef, WKDownloadRef);
298     static void downloadDidFail(WKContextRef, WKDownloadRef, WKErrorRef, const void*);
299     void downloadDidFail(WKContextRef, WKDownloadRef, WKErrorRef);
300     static void downloadDidCancel(WKContextRef, WKDownloadRef, const void*);
301     void downloadDidCancel(WKContextRef, WKDownloadRef);
302     static void downloadDidReceiveServerRedirectToURL(WKContextRef, WKDownloadRef, WKURLRef, const void*);
303     void downloadDidReceiveServerRedirectToURL(WKContextRef, WKDownloadRef, WKURLRef);
304     
305     static void processDidCrash(WKPageRef, const void* clientInfo);
306     void processDidCrash();
307
308     static void didBeginNavigationGesture(WKPageRef, const void*);
309     static void willEndNavigationGesture(WKPageRef, WKBackForwardListItemRef, const void*);
310     static void didEndNavigationGesture(WKPageRef, WKBackForwardListItemRef, const void*);
311     static void didRemoveNavigationGestureSnapshot(WKPageRef, const void*);
312     void didBeginNavigationGesture(WKPageRef);
313     void willEndNavigationGesture(WKPageRef, WKBackForwardListItemRef);
314     void didEndNavigationGesture(WKPageRef, WKBackForwardListItemRef);
315     void didRemoveNavigationGestureSnapshot(WKPageRef);
316
317     static WKPluginLoadPolicy decidePolicyForPluginLoad(WKPageRef, WKPluginLoadPolicy currentPluginLoadPolicy, WKDictionaryRef pluginInformation, WKStringRef* unavailabilityDescription, const void* clientInfo);
318     WKPluginLoadPolicy decidePolicyForPluginLoad(WKPageRef, WKPluginLoadPolicy currentPluginLoadPolicy, WKDictionaryRef pluginInformation, WKStringRef* unavailabilityDescription);
319     
320
321     static void decidePolicyForNotificationPermissionRequest(WKPageRef, WKSecurityOriginRef, WKNotificationPermissionRequestRef, const void*);
322     void decidePolicyForNotificationPermissionRequest(WKPageRef, WKSecurityOriginRef, WKNotificationPermissionRequestRef);
323
324     static void unavailablePluginButtonClicked(WKPageRef, WKPluginUnavailabilityReason, WKDictionaryRef, const void*);
325
326     static void didReceiveServerRedirectForProvisionalNavigation(WKPageRef, WKNavigationRef, WKTypeRef, const void*);
327     void didReceiveServerRedirectForProvisionalNavigation(WKPageRef, WKNavigationRef, WKTypeRef);
328
329     static bool canAuthenticateAgainstProtectionSpace(WKPageRef, WKProtectionSpaceRef, const void*);
330     bool canAuthenticateAgainstProtectionSpace(WKPageRef, WKProtectionSpaceRef);
331
332     static void didReceiveAuthenticationChallenge(WKPageRef, WKAuthenticationChallengeRef, const void*);
333     void didReceiveAuthenticationChallenge(WKPageRef, WKAuthenticationChallengeRef);
334
335     static void decidePolicyForNavigationAction(WKPageRef, WKNavigationActionRef, WKFramePolicyListenerRef, WKTypeRef, const void*);
336     void decidePolicyForNavigationAction(WKFramePolicyListenerRef);
337
338     static void decidePolicyForNavigationResponse(WKPageRef, WKNavigationResponseRef, WKFramePolicyListenerRef, WKTypeRef, const void*);
339     void decidePolicyForNavigationResponse(WKNavigationResponseRef, WKFramePolicyListenerRef);
340
341     // WKContextHistoryClient
342     static void didNavigateWithNavigationData(WKContextRef, WKPageRef, WKNavigationDataRef, WKFrameRef, const void*);
343     void didNavigateWithNavigationData(WKNavigationDataRef, WKFrameRef);
344
345     static void didPerformClientRedirect(WKContextRef, WKPageRef, WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef, const void*);
346     void didPerformClientRedirect(WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef);
347
348     static void didPerformServerRedirect(WKContextRef, WKPageRef, WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef, const void*);
349     void didPerformServerRedirect(WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef);
350
351     static void didUpdateHistoryTitle(WKContextRef, WKPageRef, WKStringRef title, WKURLRef, WKFrameRef, const void*);
352     void didUpdateHistoryTitle(WKStringRef title, WKURLRef, WKFrameRef);
353
354     static WKPageRef createOtherPage(WKPageRef, WKPageConfigurationRef, WKNavigationActionRef, WKWindowFeaturesRef, const void*);
355
356     static void runModal(WKPageRef, const void* clientInfo);
357     static void runModal(PlatformWebView*);
358
359     static const char* libraryPathForTesting();
360     static const char* platformLibraryPathForTesting();
361
362     std::unique_ptr<TestInvocation> m_currentInvocation;
363
364     bool m_verbose { false };
365     bool m_printSeparators { false };
366     bool m_usingServerMode { false };
367     bool m_gcBetweenTests { false };
368     bool m_shouldDumpPixelsForAllTests { false };
369     std::vector<std::string> m_paths;
370     std::set<std::string> m_allowedHosts;
371     WKRetainPtr<WKStringRef> m_injectedBundlePath;
372     WKRetainPtr<WKStringRef> m_testPluginDirectory;
373
374     WebNotificationProvider m_webNotificationProvider;
375
376     std::unique_ptr<PlatformWebView> m_mainWebView;
377     WKRetainPtr<WKContextRef> m_context;
378     WKRetainPtr<WKPageGroupRef> m_pageGroup;
379
380     enum State {
381         Initial,
382         Resetting,
383         RunningTest
384     };
385     State m_state { Initial };
386     bool m_doneResetting { false };
387
388     bool m_useWaitToDumpWatchdogTimer { true };
389     bool m_forceNoTimeout { false };
390
391     bool m_didPrintWebProcessCrashedMessage { false };
392     bool m_shouldExitWhenWebProcessCrashes { true };
393     
394     bool m_beforeUnloadReturnValue { true };
395
396     std::unique_ptr<GeolocationProviderMock> m_geolocationProvider;
397     Vector<WKRetainPtr<WKGeolocationPermissionRequestRef> > m_geolocationPermissionRequests;
398     bool m_isGeolocationPermissionSet { false };
399     bool m_isGeolocationPermissionAllowed { false };
400
401     HashMap<String, RefPtr<OriginSettings>> m_cachedUserMediaPermissions;
402
403     typedef Vector<std::pair<String, WKRetainPtr<WKUserMediaPermissionRequestRef>>> PermissionRequestList;
404     PermissionRequestList m_userMediaPermissionRequests;
405
406     bool m_isUserMediaPermissionSet { false };
407     bool m_isUserMediaPermissionAllowed { false };
408
409     bool m_policyDelegateEnabled { false };
410     bool m_policyDelegatePermissive { false };
411     bool m_shouldDownloadUndisplayableMIMETypes { false };
412
413     bool m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges { false };
414     bool m_handlesAuthenticationChallenges { false };
415     String m_authenticationUsername;
416     String m_authenticationPassword;
417
418     bool m_shouldBlockAllPlugins { false };
419     String m_unsupportedPluginMode;
420
421     bool m_forceComplexText { false };
422     bool m_shouldUseAcceleratedDrawing { false };
423     bool m_shouldUseRemoteLayerTree { false };
424
425     bool m_shouldLogCanAuthenticateAgainstProtectionSpace { false };
426     bool m_shouldLogDownloadCallbacks { false };
427     bool m_shouldLogHistoryClientCallbacks { false };
428     bool m_shouldShowWebView { false };
429     
430     bool m_shouldShowTouches { false };
431
432     bool m_allowAnyHTTPSCertificateForAllowedHosts { false };
433     
434     bool m_shouldDecideNavigationPolicyAfterDelay { false };
435     bool m_shouldDecideResponsePolicyAfterDelay { false };
436
437     bool m_didReceiveServerRedirectForProvisionalNavigation { false };
438
439     WKRetainPtr<WKArrayRef> m_openPanelFileURLs;
440
441     std::unique_ptr<EventSenderProxy> m_eventSenderProxy;
442
443     WorkQueueManager m_workQueueManager;
444 };
445
446 struct TestCommand {
447     std::string pathOrURL;
448     std::string absolutePath;
449     bool shouldDumpPixels { false };
450     std::string expectedPixelHash;
451     int timeout { 0 };
452     bool dumpJSConsoleLogInStdErr { false };
453 };
454
455 } // namespace WTR
456
457 #endif // TestController_h