~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Tools/DumpRenderTree/wx/TestRunnerWx.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

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