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
39
~LayoutTestController()40 LayoutTestController::~LayoutTestController()
41 {
42 // FIXME: implement
43 }
44
addDisallowedURL(JSStringRef url)45 void LayoutTestController::addDisallowedURL(JSStringRef url)
46 {
47 // FIXME: implement
48 }
49
clearBackForwardList()50 void LayoutTestController::clearBackForwardList()
51 {
52 }
53
copyDecodedHostName(JSStringRef name)54 JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name)
55 {
56 // FIXME: implement
57 return 0;
58 }
59
copyEncodedHostName(JSStringRef name)60 JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name)
61 {
62 // FIXME: implement
63 return 0;
64 }
65
dispatchPendingLoadRequests()66 void LayoutTestController::dispatchPendingLoadRequests()
67 {
68 // FIXME: Implement for testing fix for 6727495
69 }
70
display()71 void LayoutTestController::display()
72 {
73 }
74
keepWebHistory()75 void LayoutTestController::keepWebHistory()
76 {
77 // FIXME: implement
78 }
79
notifyDone()80 void LayoutTestController::notifyDone()
81 {
82 if (m_waitToDump && !WorkQueue::shared()->count())
83 notifyDoneFired();
84 m_waitToDump = false;
85 }
86
pathToLocalResource(JSContextRef context,JSStringRef url)87 JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url)
88 {
89 // Function introduced in r28690. This may need special-casing on Windows.
90 return JSStringRetain(url); // Do nothing on Unix.
91 }
92
queueLoad(JSStringRef url,JSStringRef target)93 void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
94 {
95 // FIXME: We need to resolve relative URLs here
96 WorkQueue::shared()->queue(new LoadItem(url, target));
97 }
98
setAcceptsEditing(bool acceptsEditing)99 void LayoutTestController::setAcceptsEditing(bool acceptsEditing)
100 {
101 }
102
setCustomPolicyDelegate(bool,bool)103 void LayoutTestController::setCustomPolicyDelegate(bool, bool)
104 {
105 // FIXME: implement
106 }
107
setMainFrameIsFirstResponder(bool flag)108 void LayoutTestController::setMainFrameIsFirstResponder(bool flag)
109 {
110 // FIXME: implement
111 }
112
setTabKeyCyclesThroughElements(bool cycles)113 void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles)
114 {
115 // FIXME: implement
116 }
117
setUseDashboardCompatibilityMode(bool flag)118 void LayoutTestController::setUseDashboardCompatibilityMode(bool flag)
119 {
120 // FIXME: implement
121 }
122
setUserStyleSheetEnabled(bool flag)123 void LayoutTestController::setUserStyleSheetEnabled(bool flag)
124 {
125 }
126
setUserStyleSheetLocation(JSStringRef path)127 void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
128 {
129 }
130
setWindowIsKey(bool windowIsKey)131 void LayoutTestController::setWindowIsKey(bool windowIsKey)
132 {
133 // FIXME: implement
134 }
135
setSmartInsertDeleteEnabled(bool flag)136 void LayoutTestController::setSmartInsertDeleteEnabled(bool flag)
137 {
138 // FIXME: implement
139 }
140
setJavaScriptProfilingEnabled(bool flag)141 void LayoutTestController::setJavaScriptProfilingEnabled(bool flag)
142 {
143 }
144
setWaitToDump(bool waitUntilDone)145 void LayoutTestController::setWaitToDump(bool waitUntilDone)
146 {
147 static const int timeoutSeconds = 10;
148
149 m_waitToDump = waitUntilDone;
150 }
151
windowCount()152 int LayoutTestController::windowCount()
153 {
154 // FIXME: implement
155 return 1;
156 }
157
setPrivateBrowsingEnabled(bool privateBrowsingEnabled)158 void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
159 {
160 // FIXME: implement
161 }
162
setXSSAuditorEnabled(bool enabled)163 void LayoutTestController::setXSSAuditorEnabled(bool enabled)
164 {
165 // FIXME: implement
166 }
167
setAuthorAndUserStylesEnabled(bool flag)168 void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
169 {
170 // FIXME: implement
171 }
172
setPopupBlockingEnabled(bool popupBlockingEnabled)173 void LayoutTestController::setPopupBlockingEnabled(bool popupBlockingEnabled)
174 {
175 // FIXME: implement
176 }
177
elementDoesAutoCompleteForElementWithId(JSStringRef id)178 bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id)
179 {
180 // FIXME: implement
181 return false;
182 }
183
execCommand(JSStringRef name,JSStringRef value)184 void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
185 {
186 // FIXME: implement
187 }
188
setPersistentUserStyleSheetLocation(JSStringRef jsURL)189 void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
190 {
191 // FIXME: implement
192 }
193
clearPersistentUserStyleSheet()194 void LayoutTestController::clearPersistentUserStyleSheet()
195 {
196 // FIXME: implement
197 }
198
clearAllDatabases()199 void LayoutTestController::clearAllDatabases()
200 {
201 // FIXME: implement
202 }
203
setDatabaseQuota(unsigned long long quota)204 void LayoutTestController::setDatabaseQuota(unsigned long long quota)
205 {
206 // FIXME: implement
207 }
208
setAppCacheMaximumSize(unsigned long long size)209 void LayoutTestController::setAppCacheMaximumSize(unsigned long long size)
210 {
211 // FIXME: implement
212 }
213
numberOfActiveAnimations() const214 unsigned LayoutTestController::numberOfActiveAnimations() const
215 {
216 // FIXME: implement
217 return 0;
218 }
219
setSelectTrailingWhitespaceEnabled(bool flag)220 void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag)
221 {
222 // FIXME: implement
223 }
224
pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName,double time,JSStringRef elementId)225 bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
226 {
227 // FIXME: implement
228 return false;
229 }
230
setIconDatabaseEnabled(bool iconDatabaseEnabled)231 void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
232 {
233 // FIXME: implement
234 }
235
pauseAnimationAtTimeOnElementWithId(JSStringRef animationName,double time,JSStringRef elementId)236 bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
237 {
238 // FIXME: implement
239 return false;
240 }
241
setCacheModel(int)242 void LayoutTestController::setCacheModel(int)
243 {
244 // FIXME: implement
245 }
246
isCommandEnabled(JSStringRef)247 bool LayoutTestController::isCommandEnabled(JSStringRef /*name*/)
248 {
249 // FIXME: implement
250 return false;
251 }
252
webHistoryItemCount()253 size_t LayoutTestController::webHistoryItemCount()
254 {
255 // FIXME: implement
256 return 0;
257 }
258
waitForPolicyDelegate()259 void LayoutTestController::waitForPolicyDelegate()
260 {
261 // FIXME: Implement this.
262 }
263