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

Side by Side Diff: content/shell/webkit_test_runner.cc

Issue 11573035: [content shell] implement testRunner.execCommand (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comment Created 8 years 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
« no previous file with comments | « content/shell/webkit_test_runner.h ('k') | content/shell/webkit_test_runner.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/md5.h" 9 #include "base/md5.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 Send(new ShellViewHostMsg_CloseWebInspector(routing_id())); 321 Send(new ShellViewHostMsg_CloseWebInspector(routing_id()));
322 } 322 }
323 323
324 void WebKitTestRunner::EvaluateInWebInspector(int32_t call_id, 324 void WebKitTestRunner::EvaluateInWebInspector(int32_t call_id,
325 const std::string& script) { 325 const std::string& script) {
326 WebDevToolsAgent* agent = render_view()->GetWebView()->devToolsAgent(); 326 WebDevToolsAgent* agent = render_view()->GetWebView()->devToolsAgent();
327 if (agent) 327 if (agent)
328 agent->evaluateInWebInspector(call_id, WebString::fromUTF8(script)); 328 agent->evaluateInWebInspector(call_id, WebString::fromUTF8(script));
329 } 329 }
330 330
331 void WebKitTestRunner::ExecCommand(const std::string& command,
332 const std::string& value) {
333 render_view()->GetWebView()->focusedFrame()->executeCommand(
334 WebString::fromUTF8(command), WebString::fromUTF8(value));
335 }
336
331 void WebKitTestRunner::NotImplemented(const std::string& object, 337 void WebKitTestRunner::NotImplemented(const std::string& object,
332 const std::string& method) { 338 const std::string& method) {
333 Send(new ShellViewHostMsg_NotImplemented(routing_id(), object, method)); 339 Send(new ShellViewHostMsg_NotImplemented(routing_id(), object, method));
334 } 340 }
335 341
336 void WebKitTestRunner::Reset() { 342 void WebKitTestRunner::Reset() {
337 prefs_ = ShellWebPreferences(); 343 prefs_ = ShellWebPreferences();
338 webkit_glue::WebPreferences prefs = render_view()->GetWebkitPreferences(); 344 webkit_glue::WebPreferences prefs = render_view()->GetWebkitPreferences();
339 prefs_.Apply(&prefs); 345 prefs_.Apply(&prefs);
340 render_view()->SetWebkitPreferences(prefs); 346 render_view()->SetWebkitPreferences(prefs);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 PaintRect(rect); 466 PaintRect(rect);
461 } 467 }
462 CHECK(proxy_->paintRect().isEmpty()); 468 CHECK(proxy_->paintRect().isEmpty());
463 } 469 }
464 470
465 void WebKitTestRunner::DisplayRepaintMask() { 471 void WebKitTestRunner::DisplayRepaintMask() {
466 GetCanvas()->drawARGB(167, 0, 0, 0); 472 GetCanvas()->drawARGB(167, 0, 0, 0);
467 } 473 }
468 474
469 } // namespace content 475 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/webkit_test_runner.h ('k') | content/shell/webkit_test_runner.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698