Chromium Code Reviews| 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 if (!new_size.isEmpty()) | |
| 354 ForceResizeRenderView(render_view(), new_size); | |
| 355 DisableAutoResizeMode(render_view(), new_size); | |
| 356 if (!new_size.isEmpty()) | |
| 357 render_view()->GetWebView()->resize(new_size); | |
|
piman
2013/05/14 19:27:37
DisableAutoResizeMode will call RenderViewImpl::On
jochen (gone - plz use gerrit)
2013/05/21 13:49:11
Cleaned this up as well.
I still need one ForceRe
| |
| 358 } | |
| 359 | |
| 347 void WebKitTestRunner::showDevTools() { | 360 void WebKitTestRunner::showDevTools() { |
| 348 Send(new ShellViewHostMsg_ShowDevTools(routing_id())); | 361 Send(new ShellViewHostMsg_ShowDevTools(routing_id())); |
| 349 } | 362 } |
| 350 | 363 |
| 351 void WebKitTestRunner::closeDevTools() { | 364 void WebKitTestRunner::closeDevTools() { |
| 352 Send(new ShellViewHostMsg_CloseDevTools(routing_id())); | 365 Send(new ShellViewHostMsg_CloseDevTools(routing_id())); |
| 353 } | 366 } |
| 354 | 367 |
| 355 void WebKitTestRunner::evaluateInWebInspector(long call_id, | 368 void WebKitTestRunner::evaluateInWebInspector(long call_id, |
| 356 const std::string& script) { | 369 const std::string& script) { |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 698 ->loadRequest(WebURLRequest(GURL("about:blank"))); | 711 ->loadRequest(WebURLRequest(GURL("about:blank"))); |
| 699 Send(new ShellViewHostMsg_ResetDone(routing_id())); | 712 Send(new ShellViewHostMsg_ResetDone(routing_id())); |
| 700 } | 713 } |
| 701 | 714 |
| 702 void WebKitTestRunner::OnNotifyDone() { | 715 void WebKitTestRunner::OnNotifyDone() { |
| 703 render_view()->GetWebView()->mainFrame()->executeScript( | 716 render_view()->GetWebView()->mainFrame()->executeScript( |
| 704 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); | 717 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); |
| 705 } | 718 } |
| 706 | 719 |
| 707 } // namespace content | 720 } // namespace content |
| OLD | NEW |