Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(551)

Side by Side Diff: webkit/mocks/mock_webframe.cc

Issue 6973051: Remove MockWebFrame in favour of MockWebFrameClient and update corresponding tests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: whitespace Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "webkit/mocks/mock_webframe.h"
6
7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h"
8
9 namespace webkit_glue {
10
11 MockWebFrame::MockWebFrame() {}
12
13 MockWebFrame::~MockWebFrame() {}
14
15 WebString MockWebFrame::name() const {
16 return WebString();
17 }
18
19 void MockWebFrame::setName(const WebString&) {}
20
21 long long MockWebFrame::identifier() const {
22 return 0;
23 }
24
25 WebURL MockWebFrame::url() const {
26 return WebURL();
27 }
28
29 WebURL MockWebFrame::favIconURL() const {
30 return WebURL();
31 }
32
33 WebURL MockWebFrame::openSearchDescriptionURL() const {
34 return WebURL();
35 }
36
37 WebString MockWebFrame::encoding() const {
38 return WebString();
39 }
40
41 void MockWebFrame::setCanHaveScrollbars(bool) {}
42
43 WebSize MockWebFrame::scrollOffset() const {
44 return WebSize(0,0);
45 }
46
47 void MockWebFrame::setScrollOffset(const WebSize&) {}
48
49 WebSize MockWebFrame::contentsSize() const {
50 return WebSize();
51 }
52
53 int MockWebFrame::contentsPreferredWidth() const {
54 return 0;
55 }
56
57 int MockWebFrame::documentElementScrollHeight() const {
58 return 0;
59 }
60
61 bool MockWebFrame::hasVisibleContent() const {
62 return false;
63 }
64
65 WebView* MockWebFrame::view() const {
66 return NULL;
67 }
68
69 WebFrame* MockWebFrame::opener() const {
70 return NULL;
71 }
72
73 void MockWebFrame::clearOpener() {
74 }
75
76 WebFrame* MockWebFrame::parent() const {
77 return NULL;
78 }
79
80 WebFrame* MockWebFrame::top() const {
81 return NULL;
82 }
83
84 WebFrame* MockWebFrame::firstChild() const {
85 return NULL;
86 }
87
88 WebFrame* MockWebFrame::lastChild() const {
89 return NULL;
90 }
91
92 WebFrame* MockWebFrame::nextSibling() const {
93 return NULL;
94 }
95
96 WebFrame* MockWebFrame::previousSibling() const {
97 return NULL;
98 }
99
100 WebFrame* MockWebFrame::traverseNext(bool wrap) const {
101 return NULL;
102 }
103
104 WebFrame* MockWebFrame::traversePrevious(bool wrap) const {
105 return NULL;
106 }
107
108 WebFrame* MockWebFrame::findChildByName(const WebString& name) const {
109 return NULL;
110 }
111
112 WebFrame* MockWebFrame::findChildByExpression(const WebString& xpath) const {
113 return NULL;
114 }
115
116 WebDocument MockWebFrame::document() const {
117 return WebDocument();
118 }
119
120 void MockWebFrame::forms(WebVector<WebFormElement>&) const {}
121
122 WebAnimationController* MockWebFrame::animationController() {
123 return NULL;
124 }
125
126 WebPerformance MockWebFrame::performance() const {
127 return WebPerformance();
128 }
129
130 WebSecurityOrigin MockWebFrame::securityOrigin() const {
131 return WebSecurityOrigin();
132 }
133
134 void MockWebFrame::grantUniversalAccess() {}
135
136 NPObject* MockWebFrame::windowObject() const {
137 return NULL;
138 }
139
140 void MockWebFrame::bindToWindowObject(const WebString& name, NPObject*) {}
141
142 void MockWebFrame::executeScript(const WebScriptSource&) {}
143
144 void MockWebFrame::executeScriptInIsolatedWorld(
145 int worldId, const WebScriptSource* sources, unsigned numSources,
146 int extensionGroup) {}
147
148 void MockWebFrame::addMessageToConsole(const WebConsoleMessage&) {}
149
150 void MockWebFrame::collectGarbage() {}
151
152 #if WEBKIT_USING_V8
153 v8::Handle<v8::Value> MockWebFrame::executeScriptAndReturnValue(
154 const WebScriptSource&) {
155 return v8::Handle<v8::Value>();
156 }
157
158 v8::Local<v8::Context> MockWebFrame::mainWorldScriptContext() const {
159 return v8::Local<v8::Context>();
160 }
161
162 #ifdef WEB_FILE_SYSTEM_TYPE_EXTERNAL
163 v8::Handle<v8::Value> MockWebFrame::createFileSystem(
164 WebKit::WebFileSystem::Type type, const WebString& name,
165 const WebString& path) {
166 return v8::Handle<v8::Value>();
167 }
168
169 v8::Handle<v8::Value> MockWebFrame::createFileEntry(
170 WebKit::WebFileSystem::Type type, const WebString& fileSystemName,
171 const WebString& fileSystemPath, const WebString& filePath,
172 bool isDirectory) {
173 return v8::Handle<v8::Value>();
174 }
175 #else
176 v8::Handle<v8::Value> MockWebFrame::createFileSystem(
177 int type, const WebString& name,
178 const WebString& path) {
179 return v8::Handle<v8::Value>();
180 }
181
182 v8::Handle<v8::Value> MockWebFrame::createFileEntry(
183 int type, const WebString& fileSystemName,
184 const WebString& fileSystemPath, const WebString& filePath,
185 bool isDirectory) {
186 return v8::Handle<v8::Value>();
187 }
188 #endif
189 #endif
190
191
192 bool MockWebFrame::insertStyleText(const WebString& styleText,
193 const WebString& elementId) {
194 return false;
195 }
196
197 void MockWebFrame::reload(bool ignoreCache) {}
198
199 void MockWebFrame::loadRequest(const WebURLRequest&) {}
200
201 void MockWebFrame::loadHistoryItem(const WebHistoryItem&) {}
202
203 void MockWebFrame::loadData(const WebData& data,
204 const WebString& mimeType,
205 const WebString& textEncoding,
206 const WebURL& baseURL,
207 const WebURL& unreachableURL,
208 bool replace) {}
209
210 void MockWebFrame::loadHTMLString(const WebData& html,
211 const WebURL& baseURL,
212 const WebURL& unreachableURL,
213 bool replace) {}
214
215 bool MockWebFrame::isLoading() const {
216 return false;
217 }
218
219 void MockWebFrame::stopLoading() {}
220
221 WebKit::WebDataSource* MockWebFrame::provisionalDataSource() const {
222 return NULL;
223 }
224
225 WebKit::WebDataSource* MockWebFrame::dataSource() const {
226 return NULL;
227 }
228
229 WebHistoryItem MockWebFrame::previousHistoryItem() const {
230 return WebHistoryItem();
231 }
232
233 WebHistoryItem MockWebFrame::currentHistoryItem() const {
234 return WebHistoryItem();
235 }
236
237 void MockWebFrame::enableViewSourceMode(bool) {}
238
239 bool MockWebFrame::isViewSourceModeEnabled() const {
240 return false;
241 }
242
243 // TODO(bbudge) remove once WebKit change lands.
244 WebURLLoader* MockWebFrame::createAssociatedURLLoader() {
245 return NULL;
246 }
247
248 WebURLLoader* MockWebFrame::createAssociatedURLLoader(
249 const WebURLLoaderOptions& options) {
250 return NULL;
251 }
252
253 void MockWebFrame::commitDocumentData(const char* data, size_t length) {}
254
255 unsigned MockWebFrame::unloadListenerCount() const {
256 return 0;
257 }
258
259 bool MockWebFrame::isProcessingUserGesture() const {
260 return false;
261 }
262
263 bool MockWebFrame::willSuppressOpenerInNewFrame() const {
264 return false;
265 }
266
267 void MockWebFrame::replaceSelection(const WebString& text) {}
268
269 void MockWebFrame::insertText(const WebString& text) {}
270
271 void MockWebFrame::setMarkedText(const WebString& text,
272 unsigned location,
273 unsigned length) {}
274
275 void MockWebFrame::unmarkText() {}
276
277 bool MockWebFrame::hasMarkedText() const {
278 return false;
279 }
280
281 WebRange MockWebFrame::markedRange() const {
282 return WebRange();
283 }
284
285 bool MockWebFrame::firstRectForCharacterRange(unsigned location,
286 unsigned length,
287 WebRect&) const {
288 return false;
289 }
290
291 size_t MockWebFrame::characterIndexForPoint(const WebPoint&) const {
292 return 0U;
293 }
294
295 bool MockWebFrame::executeCommand(const WebString&) {
296 return false;
297 }
298
299 bool MockWebFrame::executeCommand(const WebString&, const WebString& value) {
300 return false;
301 }
302
303 bool MockWebFrame::isCommandEnabled(const WebString&) const {
304 return false;
305 }
306
307 void MockWebFrame::enableContinuousSpellChecking(bool) {}
308
309 bool MockWebFrame::isContinuousSpellCheckingEnabled() const {
310 return false;
311 }
312
313 bool MockWebFrame::hasSelection() const {
314 return false;
315 }
316
317 WebRange MockWebFrame::selectionRange() const {
318 return WebRange();
319 }
320
321 WebString MockWebFrame::selectionAsText() const {
322 return WebString();
323 }
324
325 WebString MockWebFrame::selectionAsMarkup() const {
326 return WebString();
327 }
328
329 bool MockWebFrame::selectWordAroundCaret() {
330 return false;
331 }
332
333 void MockWebFrame::selectRange(const WebPoint& start, const WebPoint& end) {
334 }
335
336 int MockWebFrame::printBegin(const WebSize& pageSize,
337 const WebNode& constrainToNode,
338 int printerDPI,
339 bool* useBrowserOverlays) {
340 return 0;
341 }
342
343 float MockWebFrame::getPrintPageShrink(int page) {
344 return 0;
345 }
346
347 float MockWebFrame::printPage(int pageToPrint, WebCanvas*) {
348 return 0;
349 }
350
351 void MockWebFrame::printEnd() {}
352
353 bool MockWebFrame::isPageBoxVisible(int pageIndex) {
354 return false;
355 }
356
357 void MockWebFrame::pageSizeAndMarginsInPixels(int pageIndex,
358 WebSize& pageSize,
359 int& marginTop,
360 int& marginRight,
361 int& marginBottom,
362 int& marginLeft) {}
363
364 bool MockWebFrame::find(int identifier,
365 const WebString& searchText,
366 const WebFindOptions& options,
367 bool wrapWithinFrame,
368 WebRect* selectionRect) {
369 return false;
370 }
371
372 void MockWebFrame::stopFinding(bool clearSelection) {}
373
374 void MockWebFrame::scopeStringMatches(int identifier,
375 const WebString& searchText,
376 const WebFindOptions& options,
377 bool reset) {}
378
379 void MockWebFrame::cancelPendingScopingEffort() {}
380
381 void MockWebFrame::increaseMatchCount(int count, int identifier) {}
382
383 void MockWebFrame::resetMatchCount() {}
384
385 bool MockWebFrame::registerPasswordListener(
386 WebInputElement,
387 WebPasswordAutocompleteListener*) {
388 return false;
389 }
390
391 void MockWebFrame::notifiyPasswordListenerOfAutocomplete(
392 const WebInputElement&) {}
393
394 WebString MockWebFrame::contentAsText(size_t maxChars) const {
395 return WebString();
396 }
397
398 WebString MockWebFrame::contentAsMarkup() const {
399 return WebString();
400 }
401
402 WebString MockWebFrame::renderTreeAsText(bool showDebugInfo) const {
403 return WebString();
404 }
405
406 WebString MockWebFrame::renderTreeAsText() const {
407 return WebString();
408 }
409
410 WebString MockWebFrame::counterValueForElementById(const WebString& id) const {
411 return WebString();
412 }
413
414 WebString MockWebFrame::markerTextForListItem(const WebElement&) const {
415 return WebString();
416 }
417
418 int MockWebFrame::pageNumberForElementById(const WebString& id,
419 float pageWidthInPixels,
420 float pageHeightInPixels) const {
421 return 0;
422 }
423
424 WebRect MockWebFrame::selectionBoundsRect() const {
425 return WebRect();
426 }
427
428 bool MockWebFrame::selectionStartHasSpellingMarkerFor(int from,
429 int length) const {
430 return false;
431 }
432
433 bool MockWebFrame::pauseSVGAnimation(const WebString& animationId,
434 double time,
435 const WebString& elementId) {
436 return false;
437 }
438
439 WebString MockWebFrame::layerTreeAsText(bool showDebugInfo) const {
440 return WebString();
441 }
442
443 WebString MockWebFrame::layerTreeAsText() const {
444 return WebString();
445 }
446
447 } // namespace webkit_glue
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698