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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |