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::setWindowIsKey(bool windowIsKey) |
|
139 { |
|
140 // FIXME: implement |
|
141 } |
|
142 |
|
143 void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) |
|
144 { |
|
145 // FIXME: implement |
|
146 } |
|
147 |
|
148 void LayoutTestController::setJavaScriptProfilingEnabled(bool flag) |
|
149 { |
|
150 } |
|
151 |
|
152 void LayoutTestController::setWaitToDump(bool waitUntilDone) |
|
153 { |
|
154 static const int timeoutSeconds = 10; |
|
155 |
|
156 m_waitToDump = waitUntilDone; |
|
157 } |
|
158 |
|
159 int LayoutTestController::windowCount() |
|
160 { |
|
161 // FIXME: implement |
|
162 return 1; |
|
163 } |
|
164 |
|
165 void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled) |
|
166 { |
|
167 // FIXME: implement |
|
168 } |
|
169 |
|
170 void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled) |
|
171 { |
|
172 // FIXME: implement |
|
173 } |
|
174 |
|
175 void LayoutTestController::setXSSAuditorEnabled(bool enabled) |
|
176 { |
|
177 // FIXME: implement |
|
178 } |
|
179 |
|
180 void LayoutTestController::setFrameFlatteningEnabled(bool enabled) |
|
181 { |
|
182 // FIXME: implement |
|
183 } |
|
184 |
|
185 void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) |
|
186 { |
|
187 // FIXME: implement |
|
188 } |
|
189 |
|
190 void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) |
|
191 { |
|
192 // FIXME: implement |
|
193 } |
|
194 |
|
195 void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) |
|
196 { |
|
197 // FIXME: implement |
|
198 } |
|
199 |
|
200 void LayoutTestController::setPopupBlockingEnabled(bool popupBlockingEnabled) |
|
201 { |
|
202 // FIXME: implement |
|
203 } |
|
204 |
|
205 void LayoutTestController::setPluginsEnabled(bool flag) |
|
206 { |
|
207 // FIXME: Implement |
|
208 } |
|
209 |
|
210 bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) |
|
211 { |
|
212 // FIXME: implement |
|
213 return false; |
|
214 } |
|
215 |
|
216 void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) |
|
217 { |
|
218 // FIXME: implement |
|
219 } |
|
220 |
|
221 void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL) |
|
222 { |
|
223 // FIXME: implement |
|
224 } |
|
225 |
|
226 void LayoutTestController::clearPersistentUserStyleSheet() |
|
227 { |
|
228 // FIXME: implement |
|
229 } |
|
230 |
|
231 void LayoutTestController::clearAllDatabases() |
|
232 { |
|
233 // FIXME: implement |
|
234 } |
|
235 |
|
236 void LayoutTestController::setDatabaseQuota(unsigned long long quota) |
|
237 { |
|
238 // FIXME: implement |
|
239 } |
|
240 |
|
241 void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool, JSStringRef) |
|
242 { |
|
243 // FIXME: implement |
|
244 } |
|
245 |
|
246 void LayoutTestController::setAppCacheMaximumSize(unsigned long long size) |
|
247 { |
|
248 // FIXME: implement |
|
249 } |
|
250 |
|
251 unsigned LayoutTestController::numberOfActiveAnimations() const |
|
252 { |
|
253 // FIXME: implement |
|
254 return 0; |
|
255 } |
|
256 |
|
257 unsigned LayoutTestController::workerThreadCount() const |
|
258 { |
|
259 // FIXME: implement |
|
260 return 0; |
|
261 } |
|
262 |
|
263 void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag) |
|
264 { |
|
265 // FIXME: implement |
|
266 } |
|
267 |
|
268 bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) |
|
269 { |
|
270 // FIXME: implement |
|
271 return false; |
|
272 } |
|
273 |
|
274 void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy) |
|
275 { |
|
276 // FIXME: Implement for Geolocation layout tests. |
|
277 // See https://bugs.webkit.org/show_bug.cgi?id=28264. |
|
278 } |
|
279 |
|
280 void LayoutTestController::setMockGeolocationError(int code, JSStringRef message) |
|
281 { |
|
282 // FIXME: Implement for Geolocation layout tests. |
|
283 // See https://bugs.webkit.org/show_bug.cgi?id=28264. |
|
284 } |
|
285 |
|
286 void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled) |
|
287 { |
|
288 // FIXME: implement |
|
289 } |
|
290 |
|
291 bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) |
|
292 { |
|
293 // FIXME: implement |
|
294 return false; |
|
295 } |
|
296 |
|
297 bool LayoutTestController::sampleSVGAnimationForElementAtTime(JSStringRef animationId, double time, JSStringRef elementId) |
|
298 { |
|
299 // FIXME: implement |
|
300 return false; |
|
301 } |
|
302 |
|
303 void LayoutTestController::setCacheModel(int) |
|
304 { |
|
305 // FIXME: implement |
|
306 } |
|
307 |
|
308 bool LayoutTestController::isCommandEnabled(JSStringRef /*name*/) |
|
309 { |
|
310 // FIXME: implement |
|
311 return false; |
|
312 } |
|
313 |
|
314 size_t LayoutTestController::webHistoryItemCount() |
|
315 { |
|
316 // FIXME: implement |
|
317 return 0; |
|
318 } |
|
319 |
|
320 void LayoutTestController::waitForPolicyDelegate() |
|
321 { |
|
322 // FIXME: Implement this. |
|
323 } |
|
324 |
|
325 void LayoutTestController::overridePreference(JSStringRef /* key */, JSStringRef /* value */) |
|
326 { |
|
327 // FIXME: implement |
|
328 } |
|
329 |
|
330 void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) |
|
331 { |
|
332 printf("LayoutTestController::addUserScript not implemented.\n"); |
|
333 } |
|
334 |
|
335 void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) |
|
336 { |
|
337 printf("LayoutTestController::addUserStyleSheet not implemented.\n"); |
|
338 } |
|
339 |
|
340 void LayoutTestController::showWebInspector() |
|
341 { |
|
342 // FIXME: Implement this. |
|
343 } |
|
344 |
|
345 void LayoutTestController::closeWebInspector() |
|
346 { |
|
347 // FIXME: Implement this. |
|
348 } |
|
349 |
|
350 void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script) |
|
351 { |
|
352 // FIXME: Implement this. |
|
353 } |
|
354 |
|
355 void LayoutTestController::removeAllVisitedLinks() |
|
356 { |
|
357 // FIXME: Implement this. |
|
358 } |
|
359 |
|
360 void LayoutTestController::setTimelineProfilingEnabled(bool enabled) |
|
361 { |
|
362 |
|
363 } |
|
364 |
|
365 void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldId, JSObjectRef globalObject, JSStringRef script) |
|
366 { |
|
367 |
|
368 } |
|
369 |
|
370 void LayoutTestController::disableImageLoading() |
|
371 { |
|
372 |
|
373 } |
|
374 |
|
375 void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) |
|
376 { |
|
377 // FIXME: implement |
|
378 } |
|
379 |
|
380 void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) |
|
381 { |
|
382 // FIXME: implement |
|
383 } |
|
384 |
|
385 void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) |
|
386 { |
|
387 // FIXME: implement |
|
388 } |
|
389 |
|
390 JSRetainPtr<JSStringRef> LayoutTestController::counterValueForElementById(JSStringRef id) |
|
391 { |
|
392 return 0; |
|
393 } |
|
394 |
|
395 int LayoutTestController::pageNumberForElementById(JSStringRef, float, float) |
|
396 { |
|
397 // FIXME: implement |
|
398 return -1; |
|
399 } |
|
400 |
|
401 int LayoutTestController::numberOfPages(float, float) |
|
402 { |
|
403 // FIXME: implement |
|
404 return -1; |
|
405 } |
|
406 |
|
407 void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) |
|
408 { |
|
409 |
|
410 } |
|
411 |
|
412 void LayoutTestController::apiTestGoToCurrentBackForwardItem() |
|
413 { |
|
414 |
|
415 } |
|
416 |
|
417 void LayoutTestController::setSpatialNavigationEnabled(bool) |
|
418 { |
|
419 |
|
420 } |
|
421 |
|
422 void LayoutTestController::setWebViewEditable(bool) |
|
423 { |
|
424 } |
|
425 |
|
426 bool LayoutTestController::callShouldCloseOnWebView() |
|
427 { |
|
428 return false; |
|
429 } |
|
430 |
|
431 JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const |
|
432 { |
|
433 return 0; |
|
434 } |
|
435 |
|
436 JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const |
|
437 { |
|
438 return 0; |
|
439 } |
|
440 |
|
441 JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef) |
|
442 { |
|
443 return 0; |
|
444 } |
|
445 |
|
446 void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef) |
|
447 { |
|
448 } |
|
449 |
|
450 void LayoutTestController::setEditingBehavior(const char* editingBehavior) |
|
451 { |
|
452 // FIXME: Implement |
|
453 } |
|
454 |
|
455 void LayoutTestController::abortModal() |
|
456 { |
|
457 } |
|
458 |
|
459 JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const |
|
460 { |
|
461 // FIXME: Implement |
|
462 return 0; |
|
463 } |
|
464 |
|
465 bool LayoutTestController::isPageBoxVisible(int pageNumber) const |
|
466 { |
|
467 // FIXME: Implement |
|
468 return true; |
|
469 } |
|
470 |
|
471 JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const |
|
472 { |
|
473 // FIXME: Implement |
|
474 return 0; |
|
475 } |
|
476 |
|