| 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/renderer/webkit_test_runner.h" | 5 #include "content/shell/renderer/webkit_test_runner.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <clocale> | 8 #include <clocale> |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 | 10 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 } | 337 } |
| 338 | 338 |
| 339 return base::StringPrintf("<NSError domain %s, code %d, failing URL \"%s\">", | 339 return base::StringPrintf("<NSError domain %s, code %d, failing URL \"%s\">", |
| 340 domain.c_str(), code, error.unreachableURL.spec().data()); | 340 domain.c_str(), code, error.unreachableURL.spec().data()); |
| 341 } | 341 } |
| 342 | 342 |
| 343 void WebKitTestRunner::setClientWindowRect(const WebRect& rect) { | 343 void WebKitTestRunner::setClientWindowRect(const WebRect& rect) { |
| 344 ForceResizeRenderView(render_view(), WebSize(rect.width, rect.height)); | 344 ForceResizeRenderView(render_view(), WebSize(rect.width, rect.height)); |
| 345 } | 345 } |
| 346 | 346 |
| 347 void WebKitTestRunner::enableAutoResizeMode(const WebSize& min_size, |
| 348 const WebSize& max_size) { |
| 349 EnableAutoResizeMode(render_view(), min_size, max_size); |
| 350 } |
| 351 |
| 352 void WebKitTestRunner::disableAutoResizeMode(const WebSize& new_size) { |
| 353 DisableAutoResizeMode(render_view(), new_size); |
| 354 if (!new_size.isEmpty()) |
| 355 ForceResizeRenderView(render_view(), new_size); |
| 356 } |
| 357 |
| 347 void WebKitTestRunner::showDevTools() { | 358 void WebKitTestRunner::showDevTools() { |
| 348 Send(new ShellViewHostMsg_ShowDevTools(routing_id())); | 359 Send(new ShellViewHostMsg_ShowDevTools(routing_id())); |
| 349 } | 360 } |
| 350 | 361 |
| 351 void WebKitTestRunner::closeDevTools() { | 362 void WebKitTestRunner::closeDevTools() { |
| 352 Send(new ShellViewHostMsg_CloseDevTools(routing_id())); | 363 Send(new ShellViewHostMsg_CloseDevTools(routing_id())); |
| 353 } | 364 } |
| 354 | 365 |
| 355 void WebKitTestRunner::evaluateInWebInspector(long call_id, | 366 void WebKitTestRunner::evaluateInWebInspector(long call_id, |
| 356 const std::string& script) { | 367 const std::string& script) { |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 ->loadRequest(WebURLRequest(GURL("about:blank"))); | 709 ->loadRequest(WebURLRequest(GURL("about:blank"))); |
| 699 Send(new ShellViewHostMsg_ResetDone(routing_id())); | 710 Send(new ShellViewHostMsg_ResetDone(routing_id())); |
| 700 } | 711 } |
| 701 | 712 |
| 702 void WebKitTestRunner::OnNotifyDone() { | 713 void WebKitTestRunner::OnNotifyDone() { |
| 703 render_view()->GetWebView()->mainFrame()->executeScript( | 714 render_view()->GetWebView()->mainFrame()->executeScript( |
| 704 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); | 715 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); |
| 705 } | 716 } |
| 706 | 717 |
| 707 } // namespace content | 718 } // namespace content |
| OLD | NEW |