Disabled touch adjust feature in case of SDK version.
[framework/web/webkit-efl.git] / Tools / DumpRenderTree / wx / LayoutTestControllerWx.cpp
1 /*
2  * Copyright (C) 2008 Kevin Ollivier <kevino@theolliviers.com>
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  *
8  * 1.  Redistributions of source code must retain the above copyright
9  *     notice, this list of conditions and the following disclaimer.
10  * 2.  Redistributions in binary form must reproduce the above copyright
11  *     notice, this list of conditions and the following disclaimer in the
12  *     documentation and/or other materials provided with the distribution.
13  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14  *     its contributors may be used to endorse or promote products derived
15  *     from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28
29 #include "config.h"
30 #include "LayoutTestController.h"
31
32 #include "DumpRenderTree.h"
33 #include "WorkQueue.h"
34 #include "WorkQueueItem.h"
35 #include <JavaScriptCore/JSRetainPtr.h>
36 #include <JavaScriptCore/JSStringRef.h>
37
38 #include <stdio.h>
39
40
41
42 LayoutTestController::~LayoutTestController()
43 {
44     // FIXME: implement
45 }
46
47 void LayoutTestController::addDisallowedURL(JSStringRef url)
48 {
49     // FIXME: implement
50 }
51
52 void LayoutTestController::clearBackForwardList()
53 {
54 }
55
56 JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name)
57 {
58     // FIXME: implement
59     return 0;
60 }
61
62 JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name)
63 {
64     // FIXME: implement
65     return 0;
66 }
67
68 void LayoutTestController::dispatchPendingLoadRequests()
69 {
70     // FIXME: Implement for testing fix for 6727495
71 }
72
73 void LayoutTestController::display()
74 {
75 }
76
77 void LayoutTestController::keepWebHistory()
78 {
79     // FIXME: implement
80 }
81
82 void LayoutTestController::notifyDone()
83 {
84     if (m_waitToDump && !WorkQueue::shared()->count())
85         notifyDoneFired();
86     m_waitToDump = false;
87 }
88
89 JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url)
90 {
91     // Function introduced in r28690. This may need special-casing on Windows.
92     return JSStringRetain(url); // Do nothing on Unix.
93 }
94
95 void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
96 {
97     // FIXME: We need to resolve relative URLs here
98     WorkQueue::shared()->queue(new LoadItem(url, target));
99 }
100
101 void LayoutTestController::setAcceptsEditing(bool acceptsEditing)
102 {
103 }
104
105 void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
106 {
107     // FIXME: Implement this (and restore the default value before running each test in DumpRenderTree.cpp).
108 }
109
110 void LayoutTestController::setCustomPolicyDelegate(bool, bool)
111 {
112     // FIXME: implement
113 }
114
115 void LayoutTestController::setMainFrameIsFirstResponder(bool flag)
116 {
117     // FIXME: implement
118 }
119
120 void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles)
121 {
122     // FIXME: implement
123 }
124
125 void LayoutTestController::setUseDashboardCompatibilityMode(bool flag)
126 {
127     // FIXME: implement
128 }
129
130 void LayoutTestController::setUserStyleSheetEnabled(bool flag)
131 {
132 }
133
134 void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
135 {
136 }
137
138 void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value)
139 {
140     // FIXME: implement
141 }
142
143 void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
144 {
145     // FIXME: implement
146 }
147
148 void LayoutTestController::setWindowIsKey(bool windowIsKey)
149 {
150     // FIXME: implement
151 }
152
153 void LayoutTestController::setSmartInsertDeleteEnabled(bool flag)
154 {
155     // FIXME: implement
156 }
157
158 void LayoutTestController::setWaitToDump(bool waitUntilDone)
159 {
160     static const int timeoutSeconds = 10;
161
162     m_waitToDump = waitUntilDone;
163 }
164
165 int LayoutTestController::windowCount()
166 {
167     // FIXME: implement
168     return 1;
169 }
170
171 void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
172 {
173     // FIXME: implement
174 }
175
176 void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled)
177 {
178     // FIXME: implement
179 }
180
181 void LayoutTestController::setXSSAuditorEnabled(bool enabled)
182 {
183     // FIXME: implement
184 }
185
186 void LayoutTestController::setFrameFlatteningEnabled(bool enabled)
187 {
188     // FIXME: implement
189 }
190
191 void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
192 {
193     // FIXME: implement
194 }
195
196 void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled)
197 {
198     // FIXME: implement
199 }
200
201 void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
202 {
203     // FIXME: implement
204 }
205
206 void LayoutTestController::setAutofilled(JSContextRef, JSValueRef element, bool isAutofilled)
207 {
208     // FIXME: implement
209 }
210
211 void LayoutTestController::setPopupBlockingEnabled(bool popupBlockingEnabled)
212 {
213     // FIXME: implement
214 }
215
216 void LayoutTestController::setPluginsEnabled(bool flag)
217 {
218     // FIXME: Implement
219 }
220
221 bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) 
222 {
223     // FIXME: implement
224     return false;
225 }
226
227 void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
228 {
229     // FIXME: implement
230 }
231
232 void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
233 {
234     // FIXME: implement
235 }
236
237 void LayoutTestController::clearPersistentUserStyleSheet()
238 {
239     // FIXME: implement
240 }
241
242 void LayoutTestController::clearAllApplicationCaches()
243 {
244     // FIXME: Implement to support application cache quotas.
245 }
246
247 void LayoutTestController::clearApplicationCacheForOrigin(JSStringRef url)
248 {
249     // FIXME: Implement to support deleting all application cache for an origin.
250 }
251
252 long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef originIdentifier)
253 {
254     // FIXME: Implement to support getting disk usage in bytes for an origin.
255     return 0;
256 }
257
258 void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
259 {
260     // FIXME: Implement to support application cache quotas.
261 }
262
263 long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef origin)
264 {
265     // FIXME: Implement to support getting disk usage by all application caches for an origin.
266     return 0;
267 }
268
269
270 JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context)
271 {
272     // FIXME: Implement to get origins that have application caches.
273     return 0;
274 }
275
276 void LayoutTestController::clearAllDatabases()
277 {
278     // FIXME: implement
279 }
280  
281 void LayoutTestController::setDatabaseQuota(unsigned long long quota)
282 {    
283     // FIXME: implement
284 }
285
286 void LayoutTestController::goBack()
287 {
288     // FIXME: implement to enable loader/navigation-while-deferring-loads.html
289 }
290
291 void LayoutTestController::setDefersLoading(bool)
292 {
293     // FIXME: implement to enable loader/navigation-while-deferring-loads.html
294 }
295
296 void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool, JSStringRef)
297 {
298     // FIXME: implement
299 }
300
301 void LayoutTestController::setAppCacheMaximumSize(unsigned long long size)
302 {
303     // FIXME: implement
304 }
305
306 unsigned LayoutTestController::numberOfActiveAnimations() const
307 {
308     // FIXME: implement
309     return 0;
310 }
311
312 unsigned LayoutTestController::workerThreadCount() const
313 {
314     // FIXME: implement
315     return 0;
316 }
317
318 void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag)
319 {
320     // FIXME: implement
321 }
322
323 bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
324 {
325     // FIXME: implement
326     return false;
327 }
328
329 void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
330 {
331     // FIXME: Implement for DeviceOrientation layout tests.
332     // See https://bugs.webkit.org/show_bug.cgi?id=30335.
333 }
334
335 void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
336 {
337     // FIXME: Implement for Geolocation layout tests.
338     // See https://bugs.webkit.org/show_bug.cgi?id=28264.
339 }
340
341 void LayoutTestController::setMockGeolocationError(int code, JSStringRef message)
342 {
343     // FIXME: Implement for Geolocation layout tests.
344     // See https://bugs.webkit.org/show_bug.cgi?id=28264.
345 }
346
347 void LayoutTestController::setGeolocationPermission(bool allow)
348 {
349     // FIXME: Implement for Geolocation layout tests.
350     setGeolocationPermissionCommon(allow);
351 }
352
353 int LayoutTestController::numberOfPendingGeolocationPermissionRequests()
354 {
355     // FIXME: Implement for Geolocation layout tests.
356     return -1;
357 }
358
359 void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
360 {
361     // FIXME: Implement for speech input layout tests.
362     // See https://bugs.webkit.org/show_bug.cgi?id=39485.
363 }
364
365 void LayoutTestController::setMockSpeechInputDumpRect(bool flag)
366 {
367     // FIXME: Implement for speech input layout tests.
368     // See https://bugs.webkit.org/show_bug.cgi?id=39485.
369 }
370
371 void LayoutTestController::startSpeechInput(JSContextRef inputElement)
372 {
373     // FIXME: Implement for speech input layout tests.
374     // See https://bugs.webkit.org/show_bug.cgi?id=39485.
375 }
376
377 void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
378 {
379     // FIXME: implement
380 }
381
382 bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
383 {
384     // FIXME: implement
385     return false;
386 }
387
388 void LayoutTestController::setCacheModel(int)
389 {
390     // FIXME: implement
391 }
392
393 bool LayoutTestController::isCommandEnabled(JSStringRef /*name*/)
394 {
395     // FIXME: implement
396     return false;
397 }
398
399 size_t LayoutTestController::webHistoryItemCount()
400 {
401     // FIXME: implement
402     return 0;
403 }
404
405 void LayoutTestController::waitForPolicyDelegate()
406 {
407     // FIXME: Implement this.
408 }
409
410 void LayoutTestController::overridePreference(JSStringRef /* key */, JSStringRef /* value */)
411 {
412     // FIXME: implement
413 }
414
415 void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
416 {
417     printf("LayoutTestController::addUserScript not implemented.\n");
418 }
419
420 void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
421 {
422     printf("LayoutTestController::addUserStyleSheet not implemented.\n");
423 }
424
425 void LayoutTestController::showWebInspector()
426 {
427     // FIXME: Implement this.
428 }
429
430 void LayoutTestController::closeWebInspector()
431 {
432     // FIXME: Implement this.
433 }
434
435 void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script)
436 {
437     // FIXME: Implement this.
438 }
439
440 void LayoutTestController::removeAllVisitedLinks()
441 {
442     // FIXME: Implement this.
443 }
444
445 void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
446 {
447
448 }
449
450 void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
451 {
452
453 }
454
455 void LayoutTestController::disableImageLoading()
456 {
457
458 }
459
460 void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
461 {
462     // FIXME: implement
463 }
464
465 void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
466 {
467     // FIXME: implement
468 }
469
470 void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
471 {
472     // FIXME: implement
473 }
474
475 int LayoutTestController::numberOfPages(float, float)
476 {
477     // FIXME: implement
478     return -1;
479 }
480
481 void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
482 {
483
484 }
485
486 void LayoutTestController::apiTestGoToCurrentBackForwardItem()
487 {
488
489 }
490
491 void LayoutTestController::setSpatialNavigationEnabled(bool)
492 {
493
494 }
495
496 void LayoutTestController::setWebViewEditable(bool)
497 {
498 }
499
500 bool LayoutTestController::callShouldCloseOnWebView()
501 {
502     return false;
503 }
504
505 JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
506 {
507     return 0;
508 }
509
510 JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
511 {
512     return 0;
513 }
514
515 JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef)
516 {
517     return 0;
518 }
519
520 void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
521 {
522 }
523
524 void LayoutTestController::abortModal()
525 {
526 }
527
528 JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const
529 {
530     // FIXME: Implement
531     return 0;
532 }
533
534 JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
535 {
536     // FIXME: Implement
537     return 0;
538 }
539
540 void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool)
541 {
542     // FIXME: Implement this.
543 }
544
545 bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray)
546 {
547     // FIXME: Implement
548     return false;
549 }
550
551 void LayoutTestController::setSerializeHTTPLoads(bool)
552 {
553     // FIXME: Implement.
554 }
555
556 void LayoutTestController::setMinimumTimerInterval(double interval) {
557
558 }
559
560 void LayoutTestController::syncLocalStorage()
561 {
562     // FIXME: Implement.
563 }
564
565 void LayoutTestController::observeStorageTrackerNotifications(unsigned number)
566 {
567     // FIXME: Implement.
568 }
569
570 void LayoutTestController::deleteAllLocalStorage()
571 {
572     // FIXME: Implement.
573 }
574
575 JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context)
576 {
577     // FIXME: Implement.
578     return 0;
579 }
580
581 void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL)
582 {
583     // FIXME: Implement.
584 }
585
586 void LayoutTestController::setTextDirection(JSStringRef direction)
587 {
588     // FIXME: Implement.
589 }
590
591 void LayoutTestController::addChromeInputField()
592 {
593 }
594
595 void LayoutTestController::removeChromeInputField()
596 {
597 }
598
599 void LayoutTestController::focusWebView()
600 {
601 }
602
603 void LayoutTestController::setBackingScaleFactor(double)
604 {
605 }
606
607 void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title)
608 {
609     // FIXME: Implement.
610 }
611
612 void LayoutTestController::resetPageVisibility()
613 {
614     // FIXME: Implement this.
615 }
616
617 void LayoutTestController::setPageVisibility(const char*)
618 {
619     // FIXME: Implement this.
620 }
621
622 void LayoutTestController::setAutomaticLinkDetectionEnabled(bool)
623 {
624     // FIXME: Implement this.
625 }
626
627 void LayoutTestController::sendWebIntentResponse(JSStringRef)
628 {
629     // FIXME: Implement this.
630 }
631
632 void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
633 {
634     // FIXME: Implement this.
635 }
636
637 void LayoutTestController::setStorageDatabaseIdleInterval(double)
638 {
639     // FIXME: Implement this.
640 }