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/layout_test/blink_test_runner.h" | 5 #include "content/shell/renderer/layout_test/blink_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 |
11 #include "base/base64.h" | 11 #include "base/base64.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/debug/debugger.h" | 14 #include "base/debug/debugger.h" |
15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
16 #include "base/location.h" | |
17 #include "base/md5.h" | 16 #include "base/md5.h" |
18 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
19 #include "base/single_thread_task_runner.h" | 18 #include "base/message_loop/message_loop.h" |
20 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
21 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
22 #include "base/strings/sys_string_conversions.h" | 21 #include "base/strings/sys_string_conversions.h" |
23 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
24 #include "base/thread_task_runner_handle.h" | |
25 #include "base/time/time.h" | 23 #include "base/time/time.h" |
26 #include "components/test_runner/app_banner_client.h" | 24 #include "components/test_runner/app_banner_client.h" |
27 #include "components/test_runner/gamepad_controller.h" | 25 #include "components/test_runner/gamepad_controller.h" |
28 #include "components/test_runner/mock_screen_orientation_client.h" | 26 #include "components/test_runner/mock_screen_orientation_client.h" |
29 #include "components/test_runner/test_interfaces.h" | 27 #include "components/test_runner/test_interfaces.h" |
30 #include "components/test_runner/web_task.h" | 28 #include "components/test_runner/web_task.h" |
31 #include "components/test_runner/web_test_interfaces.h" | 29 #include "components/test_runner/web_test_interfaces.h" |
32 #include "components/test_runner/web_test_proxy.h" | 30 #include "components/test_runner/web_test_proxy.h" |
33 #include "components/test_runner/web_test_runner.h" | 31 #include "components/test_runner/web_test_runner.h" |
34 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 Send(new ShellViewHostMsg_ImageDump( | 824 Send(new ShellViewHostMsg_ImageDump( |
827 routing_id(), actual_pixel_hash, snapshot)); | 825 routing_id(), actual_pixel_hash, snapshot)); |
828 } | 826 } |
829 | 827 |
830 CaptureDumpComplete(); | 828 CaptureDumpComplete(); |
831 } | 829 } |
832 | 830 |
833 void BlinkTestRunner::CaptureDumpComplete() { | 831 void BlinkTestRunner::CaptureDumpComplete() { |
834 render_view()->GetWebView()->mainFrame()->stopLoading(); | 832 render_view()->GetWebView()->mainFrame()->stopLoading(); |
835 | 833 |
836 base::ThreadTaskRunnerHandle::Get()->PostTask( | 834 base::MessageLoop::current()->PostTask( |
837 FROM_HERE, base::Bind(base::IgnoreResult(&BlinkTestRunner::Send), | 835 FROM_HERE, base::Bind(base::IgnoreResult(&BlinkTestRunner::Send), |
838 base::Unretained(this), | 836 base::Unretained(this), |
839 new ShellViewHostMsg_TestFinished(routing_id()))); | 837 new ShellViewHostMsg_TestFinished(routing_id()))); |
840 } | 838 } |
841 | 839 |
842 void BlinkTestRunner::OnSetTestConfiguration( | 840 void BlinkTestRunner::OnSetTestConfiguration( |
843 const ShellTestConfiguration& params) { | 841 const ShellTestConfiguration& params) { |
844 test_config_ = params; | 842 test_config_ = params; |
845 is_main_window_ = true; | 843 is_main_window_ = true; |
846 | 844 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 | 887 |
890 leak_detector_->TryLeakDetection(main_frame); | 888 leak_detector_->TryLeakDetection(main_frame); |
891 } | 889 } |
892 | 890 |
893 void BlinkTestRunner::ReportLeakDetectionResult( | 891 void BlinkTestRunner::ReportLeakDetectionResult( |
894 const LeakDetectionResult& report) { | 892 const LeakDetectionResult& report) { |
895 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 893 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
896 } | 894 } |
897 | 895 |
898 } // namespace content | 896 } // namespace content |
OLD | NEW |