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 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
930 return; | 930 return; |
931 } | 931 } |
932 | 932 |
933 CaptureDumpComplete(); | 933 CaptureDumpComplete(); |
934 } | 934 } |
935 | 935 |
936 void BlinkTestRunner::OnPixelsDumpCompleted(const SkBitmap& snapshot) { | 936 void BlinkTestRunner::OnPixelsDumpCompleted(const SkBitmap& snapshot) { |
937 DCHECK_NE(0, snapshot.info().width()); | 937 DCHECK_NE(0, snapshot.info().width()); |
938 DCHECK_NE(0, snapshot.info().height()); | 938 DCHECK_NE(0, snapshot.info().height()); |
939 | 939 |
940 SkAutoLockPixels snapshot_lock(snapshot); | |
941 // The snapshot arrives from the GPU process via shared memory. Because MSan | 940 // The snapshot arrives from the GPU process via shared memory. Because MSan |
942 // can't track initializedness across processes, we must assure it that the | 941 // can't track initializedness across processes, we must assure it that the |
943 // pixels are in fact initialized. | 942 // pixels are in fact initialized. |
944 MSAN_UNPOISON(snapshot.getPixels(), snapshot.getSize()); | 943 MSAN_UNPOISON(snapshot.getPixels(), snapshot.getSize()); |
945 base::MD5Digest digest; | 944 base::MD5Digest digest; |
946 base::MD5Sum(snapshot.getPixels(), snapshot.getSize(), &digest); | 945 base::MD5Sum(snapshot.getPixels(), snapshot.getSize(), &digest); |
947 std::string actual_pixel_hash = base::MD5DigestToBase16(digest); | 946 std::string actual_pixel_hash = base::MD5DigestToBase16(digest); |
948 | 947 |
949 if (actual_pixel_hash == test_config_->expected_pixel_hash) { | 948 if (actual_pixel_hash == test_config_->expected_pixel_hash) { |
950 SkBitmap empty_image; | 949 SkBitmap empty_image; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 void BlinkTestRunner::ReportLeakDetectionResult( | 1057 void BlinkTestRunner::ReportLeakDetectionResult( |
1059 const LeakDetectionResult& report) { | 1058 const LeakDetectionResult& report) { |
1060 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 1059 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
1061 } | 1060 } |
1062 | 1061 |
1063 void BlinkTestRunner::OnDestruct() { | 1062 void BlinkTestRunner::OnDestruct() { |
1064 delete this; | 1063 delete this; |
1065 } | 1064 } |
1066 | 1065 |
1067 } // namespace content | 1066 } // namespace content |
OLD | NEW |