OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/shell/webkit_test_runner.h" | 5 #include "content/shell/webkit_test_runner.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/md5.h" | 10 #include "base/md5.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 #include "webkit/base/file_path_string_conversions.h" | 41 #include "webkit/base/file_path_string_conversions.h" |
42 #include "webkit/glue/webkit_glue.h" | 42 #include "webkit/glue/webkit_glue.h" |
43 #include "webkit/glue/webpreferences.h" | 43 #include "webkit/glue/webpreferences.h" |
44 | 44 |
45 using WebKit::Platform; | 45 using WebKit::Platform; |
46 using WebKit::WebContextMenuData; | 46 using WebKit::WebContextMenuData; |
47 using WebKit::WebDevToolsAgent; | 47 using WebKit::WebDevToolsAgent; |
48 using WebKit::WebElement; | 48 using WebKit::WebElement; |
49 using WebKit::WebFrame; | 49 using WebKit::WebFrame; |
50 using WebKit::WebGamepads; | 50 using WebKit::WebGamepads; |
51 using WebKit::WebIntentRequest; | |
52 using WebKit::WebRect; | 51 using WebKit::WebRect; |
53 using WebKit::WebSize; | 52 using WebKit::WebSize; |
54 using WebKit::WebString; | 53 using WebKit::WebString; |
55 using WebKit::WebURL; | 54 using WebKit::WebURL; |
56 using WebKit::WebURLError; | 55 using WebKit::WebURLError; |
57 using WebKit::WebVector; | 56 using WebKit::WebVector; |
58 using WebKit::WebView; | 57 using WebKit::WebView; |
59 using WebTestRunner::WebPreferences; | 58 using WebTestRunner::WebPreferences; |
60 using WebTestRunner::WebTask; | 59 using WebTestRunner::WebTask; |
61 | 60 |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 return &prefs_; | 287 return &prefs_; |
289 } | 288 } |
290 | 289 |
291 void WebKitTestRunner::applyPreferences() { | 290 void WebKitTestRunner::applyPreferences() { |
292 webkit_glue::WebPreferences prefs = render_view()->GetWebkitPreferences(); | 291 webkit_glue::WebPreferences prefs = render_view()->GetWebkitPreferences(); |
293 ExportLayoutTestSpecificPreferences(prefs_, &prefs); | 292 ExportLayoutTestSpecificPreferences(prefs_, &prefs); |
294 render_view()->SetWebkitPreferences(prefs); | 293 render_view()->SetWebkitPreferences(prefs); |
295 Send(new ShellViewHostMsg_OverridePreferences(routing_id(), prefs)); | 294 Send(new ShellViewHostMsg_OverridePreferences(routing_id(), prefs)); |
296 } | 295 } |
297 | 296 |
298 #if defined(ENABLE_WEB_INTENTS) | |
299 void WebKitTestRunner::setCurrentWebIntentRequest( | |
300 const WebIntentRequest& request) { | |
301 intent_request_ = request; | |
302 } | |
303 | |
304 WebIntentRequest* WebKitTestRunner::currentWebIntentRequest() { | |
305 return &intent_request_; | |
306 } | |
307 #endif | |
308 | |
309 std::string WebKitTestRunner::makeURLErrorDescription( | 297 std::string WebKitTestRunner::makeURLErrorDescription( |
310 const WebURLError& error) { | 298 const WebURLError& error) { |
311 std::string domain = error.domain.utf8(); | 299 std::string domain = error.domain.utf8(); |
312 int code = error.reason; | 300 int code = error.reason; |
313 | 301 |
314 if (domain == net::kErrorDomain) { | 302 if (domain == net::kErrorDomain) { |
315 domain = "NSURLErrorDomain"; | 303 domain = "NSURLErrorDomain"; |
316 switch (error.reason) { | 304 switch (error.reason) { |
317 case net::ERR_ABORTED: | 305 case net::ERR_ABORTED: |
318 code = -999; // NSURLErrorCancelled | 306 code = -999; // NSURLErrorCancelled |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 PaintRect(rect); | 587 PaintRect(rect); |
600 } | 588 } |
601 CHECK(proxy_->paintRect().isEmpty()); | 589 CHECK(proxy_->paintRect().isEmpty()); |
602 } | 590 } |
603 | 591 |
604 void WebKitTestRunner::DisplayRepaintMask() { | 592 void WebKitTestRunner::DisplayRepaintMask() { |
605 GetCanvas()->drawARGB(167, 0, 0, 0); | 593 GetCanvas()->drawARGB(167, 0, 0, 0); |
606 } | 594 } |
607 | 595 |
608 } // namespace content | 596 } // namespace content |
OLD | NEW |