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