ServiceWorker registration should store any script fetched through importScripts
[WebKit-https.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) { m_shouldBlockAllPlugins = 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 private:
217     WKRetainPtr<WKPageConfigurationRef> generatePageConfiguration(WKContextConfigurationRef);
218     WKRetainPtr<WKContextConfigurationRef> generateContextConfiguration() const;
219     void initialize(int argc, const char* argv[]);
220     void createWebViewWithOptions(const TestOptions&);
221     void run();
222
223     void runTestingServerLoop();
224     bool runTest(const char* pathOrURL);
225
226     void platformInitialize();
227     void platformDestroy();
228     WKContextRef platformAdjustContext(WKContextRef, WKContextConfigurationRef);
229     void platformInitializeContext();
230     void platformCreateWebView(WKPageConfigurationRef, const TestOptions&);
231     static PlatformWebView* platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef, const TestOptions&);
232     void platformResetPreferencesToConsistentValues();
233     void platformResetStateToConsistentValues();
234 #if PLATFORM(COCOA)
235     void cocoaPlatformInitialize();
236     void cocoaResetStateToConsistentValues();
237 #endif
238     void platformConfigureViewForTest(const TestInvocation&);
239     void platformWillRunTest(const TestInvocation&);
240     void platformRunUntil(bool& done, double timeout);
241     void platformDidCommitLoadForFrame(WKPageRef, WKFrameRef);
242     WKContextRef platformContext();
243     WKPreferencesRef platformPreferences();
244     void initializeInjectedBundlePath();
245     void initializeTestPluginDirectory();
246
247     void ensureViewSupportsOptionsForTest(const TestInvocation&);
248     TestOptions testOptionsForTest(const TestCommand&) const;
249     void updatePlatformSpecificTestOptionsForTest(TestOptions&, const std::string& pathOrURL) const;
250
251     void updateWebViewSizeForTest(const TestInvocation&);
252     void updateWindowScaleForTest(PlatformWebView*, const TestInvocation&);
253
254     void decidePolicyForGeolocationPermissionRequestIfPossible();
255     void decidePolicyForUserMediaPermissionRequestIfPossible();
256
257     // WKContextInjectedBundleClient
258     static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, const void*);
259     static void didReceiveSynchronousMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void*);
260     static WKTypeRef getInjectedBundleInitializationUserData(WKContextRef, const void *clientInfo);
261
262     // WKPageInjectedBundleClient
263     static void didReceivePageMessageFromInjectedBundle(WKPageRef, WKStringRef messageName, WKTypeRef messageBody, const void*);
264     static void didReceiveSynchronousPageMessageFromInjectedBundle(WKPageRef, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void*);
265     void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
266     WKRetainPtr<WKTypeRef> didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
267     WKRetainPtr<WKTypeRef> getInjectedBundleInitializationUserData();
268
269     void didReceiveKeyDownMessageFromInjectedBundle(WKDictionaryRef messageBodyDictionary, bool synchronous);
270
271     // WKContextClient
272     static void networkProcessDidCrash(WKContextRef, const void*);
273     void networkProcessDidCrash();
274     static void databaseProcessDidCrash(WKContextRef, const void*);
275     void databaseProcessDidCrash();
276
277     // WKPageNavigationClient
278     static void didCommitNavigation(WKPageRef, WKNavigationRef, WKTypeRef userData, const void*);
279     void didCommitNavigation(WKPageRef, WKNavigationRef);
280
281     static void didFinishNavigation(WKPageRef, WKNavigationRef, WKTypeRef userData, const void*);
282     void didFinishNavigation(WKPageRef, WKNavigationRef);
283
284     
285     // WKContextDownloadClient
286     static void downloadDidStart(WKContextRef, WKDownloadRef, const void*);
287     void downloadDidStart(WKContextRef, WKDownloadRef);
288     static WKStringRef decideDestinationWithSuggestedFilename(WKContextRef, WKDownloadRef, WKStringRef filename, bool* allowOverwrite, const void *clientInfo);
289     WKStringRef decideDestinationWithSuggestedFilename(WKContextRef, WKDownloadRef, WKStringRef filename, bool*& allowOverwrite);
290     static void downloadDidFinish(WKContextRef, WKDownloadRef, const void*);
291     void downloadDidFinish(WKContextRef, WKDownloadRef);
292     static void downloadDidFail(WKContextRef, WKDownloadRef, WKErrorRef, const void*);
293     void downloadDidFail(WKContextRef, WKDownloadRef, WKErrorRef);
294     static void downloadDidCancel(WKContextRef, WKDownloadRef, const void*);
295     void downloadDidCancel(WKContextRef, WKDownloadRef);
296     static void downloadDidReceiveServerRedirectToURL(WKContextRef, WKDownloadRef, WKURLRef, const void*);
297     void downloadDidReceiveServerRedirectToURL(WKContextRef, WKDownloadRef, WKURLRef);
298     
299     static void processDidCrash(WKPageRef, const void* clientInfo);
300     void processDidCrash();
301
302     static void didBeginNavigationGesture(WKPageRef, const void*);
303     static void willEndNavigationGesture(WKPageRef, WKBackForwardListItemRef, const void*);
304     static void didEndNavigationGesture(WKPageRef, WKBackForwardListItemRef, const void*);
305     static void didRemoveNavigationGestureSnapshot(WKPageRef, const void*);
306     void didBeginNavigationGesture(WKPageRef);
307     void willEndNavigationGesture(WKPageRef, WKBackForwardListItemRef);
308     void didEndNavigationGesture(WKPageRef, WKBackForwardListItemRef);
309     void didRemoveNavigationGestureSnapshot(WKPageRef);
310
311     static WKPluginLoadPolicy decidePolicyForPluginLoad(WKPageRef, WKPluginLoadPolicy currentPluginLoadPolicy, WKDictionaryRef pluginInformation, WKStringRef* unavailabilityDescription, const void* clientInfo);
312     WKPluginLoadPolicy decidePolicyForPluginLoad(WKPageRef, WKPluginLoadPolicy currentPluginLoadPolicy, WKDictionaryRef pluginInformation, WKStringRef* unavailabilityDescription);
313     
314
315     static void decidePolicyForNotificationPermissionRequest(WKPageRef, WKSecurityOriginRef, WKNotificationPermissionRequestRef, const void*);
316     void decidePolicyForNotificationPermissionRequest(WKPageRef, WKSecurityOriginRef, WKNotificationPermissionRequestRef);
317
318     static void unavailablePluginButtonClicked(WKPageRef, WKPluginUnavailabilityReason, WKDictionaryRef, const void*);
319
320     static void didReceiveServerRedirectForProvisionalNavigation(WKPageRef, WKNavigationRef, WKTypeRef, const void*);
321     void didReceiveServerRedirectForProvisionalNavigation(WKPageRef, WKNavigationRef, WKTypeRef);
322
323     static bool canAuthenticateAgainstProtectionSpace(WKPageRef, WKProtectionSpaceRef, const void*);
324     bool canAuthenticateAgainstProtectionSpace(WKPageRef, WKProtectionSpaceRef);
325
326     static void didReceiveAuthenticationChallenge(WKPageRef, WKAuthenticationChallengeRef, const void*);
327     void didReceiveAuthenticationChallenge(WKPageRef, WKAuthenticationChallengeRef);
328
329     static void decidePolicyForNavigationAction(WKPageRef, WKNavigationActionRef, WKFramePolicyListenerRef, WKTypeRef, const void*);
330     void decidePolicyForNavigationAction(WKFramePolicyListenerRef);
331
332     static void decidePolicyForNavigationResponse(WKPageRef, WKNavigationResponseRef, WKFramePolicyListenerRef, WKTypeRef, const void*);
333     void decidePolicyForNavigationResponse(WKNavigationResponseRef, WKFramePolicyListenerRef);
334
335     // WKContextHistoryClient
336     static void didNavigateWithNavigationData(WKContextRef, WKPageRef, WKNavigationDataRef, WKFrameRef, const void*);
337     void didNavigateWithNavigationData(WKNavigationDataRef, WKFrameRef);
338
339     static void didPerformClientRedirect(WKContextRef, WKPageRef, WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef, const void*);
340     void didPerformClientRedirect(WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef);
341
342     static void didPerformServerRedirect(WKContextRef, WKPageRef, WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef, const void*);
343     void didPerformServerRedirect(WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef);
344
345     static void didUpdateHistoryTitle(WKContextRef, WKPageRef, WKStringRef title, WKURLRef, WKFrameRef, const void*);
346     void didUpdateHistoryTitle(WKStringRef title, WKURLRef, WKFrameRef);
347
348     static WKPageRef createOtherPage(WKPageRef, WKPageConfigurationRef, WKNavigationActionRef, WKWindowFeaturesRef, const void*);
349
350     static void runModal(WKPageRef, const void* clientInfo);
351     static void runModal(PlatformWebView*);
352
353     static const char* libraryPathForTesting();
354     static const char* platformLibraryPathForTesting();
355
356     std::unique_ptr<TestInvocation> m_currentInvocation;
357
358     bool m_verbose { false };
359     bool m_printSeparators { false };
360     bool m_usingServerMode { false };
361     bool m_gcBetweenTests { false };
362     bool m_shouldDumpPixelsForAllTests { false };
363     std::vector<std::string> m_paths;
364     std::set<std::string> m_allowedHosts;
365     WKRetainPtr<WKStringRef> m_injectedBundlePath;
366     WKRetainPtr<WKStringRef> m_testPluginDirectory;
367
368     WebNotificationProvider m_webNotificationProvider;
369
370     std::unique_ptr<PlatformWebView> m_mainWebView;
371     WKRetainPtr<WKContextRef> m_context;
372     WKRetainPtr<WKPageGroupRef> m_pageGroup;
373
374     enum State {
375         Initial,
376         Resetting,
377         RunningTest
378     };
379     State m_state { Initial };
380     bool m_doneResetting { false };
381
382     bool m_useWaitToDumpWatchdogTimer { true };
383     bool m_forceNoTimeout { false };
384
385     bool m_didPrintWebProcessCrashedMessage { false };
386     bool m_shouldExitWhenWebProcessCrashes { true };
387     
388     bool m_beforeUnloadReturnValue { true };
389
390     std::unique_ptr<GeolocationProviderMock> m_geolocationProvider;
391     Vector<WKRetainPtr<WKGeolocationPermissionRequestRef> > m_geolocationPermissionRequests;
392     bool m_isGeolocationPermissionSet { false };
393     bool m_isGeolocationPermissionAllowed { false };
394
395     HashMap<String, RefPtr<OriginSettings>> m_cachedUserMediaPermissions;
396
397     typedef Vector<std::pair<String, WKRetainPtr<WKUserMediaPermissionRequestRef>>> PermissionRequestList;
398     PermissionRequestList m_userMediaPermissionRequests;
399
400     bool m_isUserMediaPermissionSet { false };
401     bool m_isUserMediaPermissionAllowed { false };
402
403     bool m_policyDelegateEnabled { false };
404     bool m_policyDelegatePermissive { false };
405     bool m_shouldDownloadUndisplayableMIMETypes { false };
406
407     bool m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges { false };
408     bool m_handlesAuthenticationChallenges { false };
409     String m_authenticationUsername;
410     String m_authenticationPassword;
411
412     bool m_shouldBlockAllPlugins { false };
413     String m_unsupportedPluginMode;
414
415     bool m_forceComplexText { false };
416     bool m_shouldUseAcceleratedDrawing { false };
417     bool m_shouldUseRemoteLayerTree { false };
418
419     bool m_shouldLogCanAuthenticateAgainstProtectionSpace { false };
420     bool m_shouldLogDownloadCallbacks { false };
421     bool m_shouldLogHistoryClientCallbacks { false };
422     bool m_shouldShowWebView { false };
423     
424     bool m_shouldShowTouches { false };
425
426     bool m_allowAnyHTTPSCertificateForAllowedHosts { false };
427     
428     bool m_shouldDecideNavigationPolicyAfterDelay { false };
429     bool m_shouldDecideResponsePolicyAfterDelay { false };
430
431     bool m_didReceiveServerRedirectForProvisionalNavigation { false };
432
433     WKRetainPtr<WKArrayRef> m_openPanelFileURLs;
434
435     std::unique_ptr<EventSenderProxy> m_eventSenderProxy;
436
437     WorkQueueManager m_workQueueManager;
438 };
439
440 struct TestCommand {
441     std::string pathOrURL;
442     std::string absolutePath;
443     bool shouldDumpPixels { false };
444     std::string expectedPixelHash;
445     int timeout { 0 };
446     bool dumpJSConsoleLogInStdErr { false };
447 };
448
449 } // namespace WTR
450
451 #endif // TestController_h