OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/layout_test/blink_test_controller.h" | 5 #include "content/shell/browser/layout_test/blink_test_controller.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <iostream> | 9 #include <iostream> |
10 #include <set> | 10 #include <set> |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 BrowserContext::GetStoragePartition(browser_context, nullptr); | 686 BrowserContext::GetStoragePartition(browser_context, nullptr); |
687 storage_partition->GetServiceWorkerContext()->ClearAllServiceWorkersForTest( | 687 storage_partition->GetServiceWorkerContext()->ClearAllServiceWorkersForTest( |
688 base::Bind(base::IgnoreResult(&BlinkTestController::Send), | 688 base::Bind(base::IgnoreResult(&BlinkTestController::Send), |
689 base::Unretained(this), | 689 base::Unretained(this), |
690 new ShellViewMsg_Reset(render_view_host->GetRoutingID()))); | 690 new ShellViewMsg_Reset(render_view_host->GetRoutingID()))); |
691 storage_partition->ClearBluetoothAllowedDevicesMapForTesting(); | 691 storage_partition->ClearBluetoothAllowedDevicesMapForTesting(); |
692 } | 692 } |
693 | 693 |
694 void BlinkTestController::OnImageDump(const std::string& actual_pixel_hash, | 694 void BlinkTestController::OnImageDump(const std::string& actual_pixel_hash, |
695 const SkBitmap& image) { | 695 const SkBitmap& image) { |
696 SkAutoLockPixels image_lock(image); | |
697 | |
698 printer_->PrintImageHeader(actual_pixel_hash, expected_pixel_hash_); | 696 printer_->PrintImageHeader(actual_pixel_hash, expected_pixel_hash_); |
699 | 697 |
700 // Only encode and dump the png if the hashes don't match. Encoding the | 698 // Only encode and dump the png if the hashes don't match. Encoding the |
701 // image is really expensive. | 699 // image is really expensive. |
702 if (actual_pixel_hash != expected_pixel_hash_) { | 700 if (actual_pixel_hash != expected_pixel_hash_) { |
703 std::vector<unsigned char> png; | 701 std::vector<unsigned char> png; |
704 | 702 |
705 bool discard_transparency = true; | 703 bool discard_transparency = true; |
706 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 704 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
707 switches::kForceOverlayFullscreenVideo)) | 705 switches::kForceOverlayFullscreenVideo)) |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 } | 1007 } |
1010 DCHECK(layout_test_control_map_[frame].get()); | 1008 DCHECK(layout_test_control_map_[frame].get()); |
1011 return layout_test_control_map_[frame].get(); | 1009 return layout_test_control_map_[frame].get(); |
1012 } | 1010 } |
1013 | 1011 |
1014 void BlinkTestController::HandleLayoutTestControlError(RenderFrameHost* frame) { | 1012 void BlinkTestController::HandleLayoutTestControlError(RenderFrameHost* frame) { |
1015 layout_test_control_map_.erase(frame); | 1013 layout_test_control_map_.erase(frame); |
1016 } | 1014 } |
1017 | 1015 |
1018 } // namespace content | 1016 } // namespace content |
OLD | NEW |