Rubber-stamped by Brady Eidson.
[webbrowser.git] / WebKitTools / DumpRenderTree / wx / LayoutTestControllerWx.cpp
blob2c469505c8d4843714755acc774a5a15ce805631
1 /*
2 * Copyright (C) 2008 Kevin Ollivier <kevino@theolliviers.com>
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
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.
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.
29 #include "config.h"
30 #include "LayoutTestController.h"
32 #include "DumpRenderTree.h"
33 #include "WorkQueue.h"
34 #include "WorkQueueItem.h"
35 #include <JavaScriptCore/JSRetainPtr.h>
36 #include <JavaScriptCore/JSStringRef.h>
40 LayoutTestController::~LayoutTestController()
42 // FIXME: implement
45 void LayoutTestController::addDisallowedURL(JSStringRef url)
47 // FIXME: implement
50 void LayoutTestController::clearBackForwardList()
54 JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name)
56 // FIXME: implement
57 return 0;
60 JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name)
62 // FIXME: implement
63 return 0;
66 void LayoutTestController::dispatchPendingLoadRequests()
68 // FIXME: Implement for testing fix for 6727495
71 void LayoutTestController::display()
75 void LayoutTestController::keepWebHistory()
77 // FIXME: implement
80 void LayoutTestController::notifyDone()
82 if (m_waitToDump && !WorkQueue::shared()->count())
83 notifyDoneFired();
84 m_waitToDump = false;
87 JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url)
89 // Function introduced in r28690. This may need special-casing on Windows.
90 return JSStringRetain(url); // Do nothing on Unix.
93 void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
95 // FIXME: We need to resolve relative URLs here
96 WorkQueue::shared()->queue(new LoadItem(url, target));
99 void LayoutTestController::setAcceptsEditing(bool acceptsEditing)
103 void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
105 // FIXME: Implement this (and restore the default value before running each test in DumpRenderTree.cpp).
108 void LayoutTestController::setCustomPolicyDelegate(bool, bool)
110 // FIXME: implement
113 void LayoutTestController::setMainFrameIsFirstResponder(bool flag)
115 // FIXME: implement
118 void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles)
120 // FIXME: implement
123 void LayoutTestController::setUseDashboardCompatibilityMode(bool flag)
125 // FIXME: implement
128 void LayoutTestController::setUserStyleSheetEnabled(bool flag)
132 void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
136 void LayoutTestController::setWindowIsKey(bool windowIsKey)
138 // FIXME: implement
141 void LayoutTestController::setSmartInsertDeleteEnabled(bool flag)
143 // FIXME: implement
146 void LayoutTestController::setJavaScriptProfilingEnabled(bool flag)
150 void LayoutTestController::setWaitToDump(bool waitUntilDone)
152 static const int timeoutSeconds = 10;
154 m_waitToDump = waitUntilDone;
157 int LayoutTestController::windowCount()
159 // FIXME: implement
160 return 1;
163 void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
165 // FIXME: implement
168 void LayoutTestController::setXSSAuditorEnabled(bool enabled)
170 // FIXME: implement
173 void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
175 // FIXME: implement
178 void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
180 // FIXME: implement
183 void LayoutTestController::setPopupBlockingEnabled(bool popupBlockingEnabled)
185 // FIXME: implement
188 bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id)
190 // FIXME: implement
191 return false;
194 void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
196 // FIXME: implement
199 void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
201 // FIXME: implement
204 void LayoutTestController::clearPersistentUserStyleSheet()
206 // FIXME: implement
209 void LayoutTestController::clearAllDatabases()
211 // FIXME: implement
214 void LayoutTestController::setDatabaseQuota(unsigned long long quota)
216 // FIXME: implement
219 void LayoutTestController::setAppCacheMaximumSize(unsigned long long size)
221 // FIXME: implement
224 unsigned LayoutTestController::numberOfActiveAnimations() const
226 // FIXME: implement
227 return 0;
230 unsigned LayoutTestController::workerThreadCount() const
232 // FIXME: implement
233 return 0;
236 void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag)
238 // FIXME: implement
241 bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
243 // FIXME: implement
244 return false;
247 void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
249 // FIXME: Implement for Geolocation layout tests.
250 // See https://bugs.webkit.org/show_bug.cgi?id=28264.
253 void LayoutTestController::setMockGeolocationError(int code, JSStringRef message)
255 // FIXME: Implement for Geolocation layout tests.
256 // See https://bugs.webkit.org/show_bug.cgi?id=28264.
259 void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
261 // FIXME: implement
264 bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
266 // FIXME: implement
267 return false;
270 bool LayoutTestController::sampleSVGAnimationForElementAtTime(JSStringRef animationId, double time, JSStringRef elementId)
272 // FIXME: implement
273 return false;
276 void LayoutTestController::setCacheModel(int)
278 // FIXME: implement
281 bool LayoutTestController::isCommandEnabled(JSStringRef /*name*/)
283 // FIXME: implement
284 return false;
287 size_t LayoutTestController::webHistoryItemCount()
289 // FIXME: implement
290 return 0;
293 void LayoutTestController::waitForPolicyDelegate()
295 // FIXME: Implement this.
298 void LayoutTestController::overridePreference(JSStringRef /* key */, JSStringRef /* value */)
300 // FIXME: implement
303 void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart)
305 printf("LayoutTestController::addUserScript not implemented.\n");
308 void LayoutTestController::addUserStyleSheet(JSStringRef source)
310 printf("LayoutTestController::addUserStyleSheet not implemented.\n");
313 void LayoutTestController::showWebInspector()
315 // FIXME: Implement this.
318 void LayoutTestController::closeWebInspector()
320 // FIXME: Implement this.
323 void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script)
325 // FIXME: Implement this.
328 void LayoutTestController::removeAllVisitedLinks()
330 // FIXME: Implement this.
333 void LayoutTestController::setTimelineProfilingEnabled(bool enabled)
338 void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldId, JSObjectRef globalObject, JSStringRef script)
343 void LayoutTestController::disableImageLoading()
348 void LayoutTestController::whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
353 JSRetainPtr<JSStringRef> LayoutTestController::counterValueForElementById(JSStringRef id)