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

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

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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
« no previous file with comments | « content/renderer/webplugin_delegate_proxy.cc ('k') | content/shell/shell.cc » ('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/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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 void WebKitTestRunner::printMessage(const std::string& message) { 215 void WebKitTestRunner::printMessage(const std::string& message) {
216 Send(new ShellViewHostMsg_PrintMessage(routing_id(), message)); 216 Send(new ShellViewHostMsg_PrintMessage(routing_id(), message));
217 } 217 }
218 218
219 void WebKitTestRunner::postTask(WebTask* task) { 219 void WebKitTestRunner::postTask(WebTask* task) {
220 Platform::current()->callOnMainThread(InvokeTaskHelper, task); 220 Platform::current()->callOnMainThread(InvokeTaskHelper, task);
221 } 221 }
222 222
223 void WebKitTestRunner::postDelayedTask(WebTask* task, long long ms) { 223 void WebKitTestRunner::postDelayedTask(WebTask* task, long long ms) {
224 MessageLoop::current()->PostDelayedTask( 224 base::MessageLoop::current()->PostDelayedTask(
225 FROM_HERE, 225 FROM_HERE,
226 base::Bind(&WebTask::run, base::Owned(task)), 226 base::Bind(&WebTask::run, base::Owned(task)),
227 base::TimeDelta::FromMilliseconds(ms)); 227 base::TimeDelta::FromMilliseconds(ms));
228 } 228 }
229 229
230 WebString WebKitTestRunner::registerIsolatedFileSystem( 230 WebString WebKitTestRunner::registerIsolatedFileSystem(
231 const WebKit::WebVector<WebKit::WebString>& absolute_filenames) { 231 const WebKit::WebVector<WebKit::WebString>& absolute_filenames) {
232 std::vector<base::FilePath> files; 232 std::vector<base::FilePath> files;
233 for (size_t i = 0; i < absolute_filenames.size(); ++i) 233 for (size_t i = 0; i < absolute_filenames.size(); ++i)
234 files.push_back(webkit_base::WebStringToFilePath(absolute_filenames[i])); 234 files.push_back(webkit_base::WebStringToFilePath(absolute_filenames[i]));
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 SkBitmap empty_image; 646 SkBitmap empty_image;
647 Send(new ShellViewHostMsg_ImageDump( 647 Send(new ShellViewHostMsg_ImageDump(
648 routing_id(), actual_pixel_hash, empty_image)); 648 routing_id(), actual_pixel_hash, empty_image));
649 } else { 649 } else {
650 Send(new ShellViewHostMsg_ImageDump( 650 Send(new ShellViewHostMsg_ImageDump(
651 routing_id(), actual_pixel_hash, snapshot)); 651 routing_id(), actual_pixel_hash, snapshot));
652 } 652 }
653 } 653 }
654 } 654 }
655 655
656 MessageLoop::current()->PostTask( 656 base::MessageLoop::current()->PostTask(
657 FROM_HERE, 657 FROM_HERE,
658 base::Bind(base::IgnoreResult(&WebKitTestRunner::Send), 658 base::Bind(base::IgnoreResult(&WebKitTestRunner::Send),
659 base::Unretained(this), 659 base::Unretained(this),
660 new ShellViewHostMsg_TestFinished(routing_id(), false))); 660 new ShellViewHostMsg_TestFinished(routing_id(), false)));
661 } 661 }
662 662
663 void WebKitTestRunner::OnSetTestConfiguration( 663 void WebKitTestRunner::OnSetTestConfiguration(
664 const ShellTestConfiguration& params) { 664 const ShellTestConfiguration& params) {
665 test_config_ = params; 665 test_config_ = params;
666 is_main_window_ = true; 666 is_main_window_ = true;
(...skipping 26 matching lines...) Expand all
693 ->loadRequest(WebURLRequest(GURL("about:blank"))); 693 ->loadRequest(WebURLRequest(GURL("about:blank")));
694 Send(new ShellViewHostMsg_ResetDone(routing_id())); 694 Send(new ShellViewHostMsg_ResetDone(routing_id()));
695 } 695 }
696 696
697 void WebKitTestRunner::OnNotifyDone() { 697 void WebKitTestRunner::OnNotifyDone() {
698 render_view()->GetWebView()->mainFrame()->executeScript( 698 render_view()->GetWebView()->mainFrame()->executeScript(
699 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); 699 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();")));
700 } 700 }
701 701
702 } // namespace content 702 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/webplugin_delegate_proxy.cc ('k') | content/shell/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698