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 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 CaptureDumpContinued(); | 916 CaptureDumpContinued(); |
917 } | 917 } |
918 | 918 |
919 void BlinkTestRunner::CaptureDumpContinued() { | 919 void BlinkTestRunner::CaptureDumpContinued() { |
920 test_runner::WebTestInterfaces* interfaces = | 920 test_runner::WebTestInterfaces* interfaces = |
921 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); | 921 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); |
922 if (test_config_->enable_pixel_dumping && | 922 if (test_config_->enable_pixel_dumping && |
923 interfaces->TestRunner()->ShouldGeneratePixelResults() && | 923 interfaces->TestRunner()->ShouldGeneratePixelResults() && |
924 !interfaces->TestRunner()->ShouldDumpAsAudio()) { | 924 !interfaces->TestRunner()->ShouldDumpAsAudio()) { |
925 CHECK(render_view()->GetWebView()->IsAcceleratedCompositingActive()); | 925 CHECK(render_view()->GetWebView()->IsAcceleratedCompositingActive()); |
| 926 |
| 927 // Test finish should only be processed in the BlinkTestRunner associated |
| 928 // with the current, non-swapped-out RenderView. |
| 929 DCHECK(render_view()->GetWebView()->MainFrame()->IsWebLocalFrame()); |
| 930 |
926 interfaces->TestRunner()->DumpPixelsAsync( | 931 interfaces->TestRunner()->DumpPixelsAsync( |
927 render_view()->GetWebView(), | 932 render_view()->GetWebView()->MainFrame()->ToWebLocalFrame(), |
928 base::Bind(&BlinkTestRunner::OnPixelsDumpCompleted, | 933 base::Bind(&BlinkTestRunner::OnPixelsDumpCompleted, |
929 base::Unretained(this))); | 934 base::Unretained(this))); |
930 return; | 935 return; |
931 } | 936 } |
932 | 937 |
933 CaptureDumpComplete(); | 938 CaptureDumpComplete(); |
934 } | 939 } |
935 | 940 |
936 void BlinkTestRunner::OnPixelsDumpCompleted(const SkBitmap& snapshot) { | 941 void BlinkTestRunner::OnPixelsDumpCompleted(const SkBitmap& snapshot) { |
937 DCHECK_NE(0, snapshot.info().width()); | 942 DCHECK_NE(0, snapshot.info().width()); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 void BlinkTestRunner::ReportLeakDetectionResult( | 1078 void BlinkTestRunner::ReportLeakDetectionResult( |
1074 const LeakDetectionResult& report) { | 1079 const LeakDetectionResult& report) { |
1075 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 1080 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
1076 } | 1081 } |
1077 | 1082 |
1078 void BlinkTestRunner::OnDestruct() { | 1083 void BlinkTestRunner::OnDestruct() { |
1079 delete this; | 1084 delete this; |
1080 } | 1085 } |
1081 | 1086 |
1082 } // namespace content | 1087 } // namespace content |
OLD | NEW |