| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <clocale> | 10 #include <clocale> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "base/strings/string_util.h" | 25 #include "base/strings/string_util.h" |
| 26 #include "base/strings/stringprintf.h" | 26 #include "base/strings/stringprintf.h" |
| 27 #include "base/strings/sys_string_conversions.h" | 27 #include "base/strings/sys_string_conversions.h" |
| 28 #include "base/strings/utf_string_conversions.h" | 28 #include "base/strings/utf_string_conversions.h" |
| 29 #include "base/thread_task_runner_handle.h" | 29 #include "base/thread_task_runner_handle.h" |
| 30 #include "base/time/time.h" | 30 #include "base/time/time.h" |
| 31 #include "base/values.h" | 31 #include "base/values.h" |
| 32 #include "build/build_config.h" | 32 #include "build/build_config.h" |
| 33 #include "components/plugins/renderer/plugin_placeholder.h" | 33 #include "components/plugins/renderer/plugin_placeholder.h" |
| 34 #include "components/test_runner/gamepad_controller.h" | 34 #include "components/test_runner/gamepad_controller.h" |
| 35 #include "components/test_runner/layout_and_paint_async_then.h" |
| 35 #include "components/test_runner/pixel_dump.h" | 36 #include "components/test_runner/pixel_dump.h" |
| 36 #include "components/test_runner/web_test_interfaces.h" | 37 #include "components/test_runner/web_test_interfaces.h" |
| 37 #include "components/test_runner/web_test_proxy.h" | 38 #include "components/test_runner/web_test_proxy.h" |
| 38 #include "components/test_runner/web_test_runner.h" | 39 #include "components/test_runner/web_test_runner.h" |
| 39 #include "content/public/common/content_switches.h" | 40 #include "content/public/common/content_switches.h" |
| 40 #include "content/public/common/service_registry.h" | 41 #include "content/public/common/service_registry.h" |
| 41 #include "content/public/common/url_constants.h" | 42 #include "content/public/common/url_constants.h" |
| 42 #include "content/public/common/web_preferences.h" | 43 #include "content/public/common/web_preferences.h" |
| 43 #include "content/public/renderer/media_stream_utils.h" | 44 #include "content/public/renderer/media_stream_utils.h" |
| 44 #include "content/public/renderer/render_frame.h" | 45 #include "content/public/renderer/render_frame.h" |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 interfaces->TestRunner()->DumpPixelsAsync( | 848 interfaces->TestRunner()->DumpPixelsAsync( |
| 848 render_view()->GetWebView(), | 849 render_view()->GetWebView(), |
| 849 base::Bind(&BlinkTestRunner::OnPixelsDumpCompleted, | 850 base::Bind(&BlinkTestRunner::OnPixelsDumpCompleted, |
| 850 base::Unretained(this))); | 851 base::Unretained(this))); |
| 851 return; | 852 return; |
| 852 } | 853 } |
| 853 | 854 |
| 854 #ifndef NDEBUG | 855 #ifndef NDEBUG |
| 855 // Force a layout/paint by the end of the test to ensure test coverage of | 856 // Force a layout/paint by the end of the test to ensure test coverage of |
| 856 // incremental painting. | 857 // incremental painting. |
| 857 proxy()->LayoutAndPaintAsyncThen(base::Bind( | 858 test_runner::LayoutAndPaintAsyncThen( |
| 858 &BlinkTestRunner::CaptureDumpComplete, base::Unretained(this))); | 859 render_view()->GetWebView(), |
| 860 base::Bind(&BlinkTestRunner::CaptureDumpComplete, |
| 861 base::Unretained(this))); |
| 859 #else | 862 #else |
| 860 CaptureDumpComplete(); | 863 CaptureDumpComplete(); |
| 861 #endif | 864 #endif |
| 862 } | 865 } |
| 863 | 866 |
| 864 void BlinkTestRunner::OnPixelsDumpCompleted(const SkBitmap& snapshot) { | 867 void BlinkTestRunner::OnPixelsDumpCompleted(const SkBitmap& snapshot) { |
| 865 DCHECK_NE(0, snapshot.info().width()); | 868 DCHECK_NE(0, snapshot.info().width()); |
| 866 DCHECK_NE(0, snapshot.info().height()); | 869 DCHECK_NE(0, snapshot.info().height()); |
| 867 | 870 |
| 868 SkAutoLockPixels snapshot_lock(snapshot); | 871 SkAutoLockPixels snapshot_lock(snapshot); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 get_bluetooth_events_callbacks_.pop_front(); | 971 get_bluetooth_events_callbacks_.pop_front(); |
| 969 callback.Run(events); | 972 callback.Run(events); |
| 970 } | 973 } |
| 971 | 974 |
| 972 void BlinkTestRunner::ReportLeakDetectionResult( | 975 void BlinkTestRunner::ReportLeakDetectionResult( |
| 973 const LeakDetectionResult& report) { | 976 const LeakDetectionResult& report) { |
| 974 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 977 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
| 975 } | 978 } |
| 976 | 979 |
| 977 } // namespace content | 980 } // namespace content |
| OLD | NEW |