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/webkit_test_runner.h" | 5 #include "content/shell/renderer/webkit_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 |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 render_view()->SetWebkitPreferences(render_view()->GetWebkitPreferences()); | 624 render_view()->SetWebkitPreferences(render_view()->GetWebkitPreferences()); |
625 } | 625 } |
626 | 626 |
627 // Private methods ----------------------------------------------------------- | 627 // Private methods ----------------------------------------------------------- |
628 | 628 |
629 void WebKitTestRunner::CaptureDump() { | 629 void WebKitTestRunner::CaptureDump() { |
630 WebTestInterfaces* interfaces = | 630 WebTestInterfaces* interfaces = |
631 ShellRenderProcessObserver::GetInstance()->test_interfaces(); | 631 ShellRenderProcessObserver::GetInstance()->test_interfaces(); |
632 | 632 |
633 if (interfaces->testRunner()->shouldDumpAsAudio()) { | 633 if (interfaces->testRunner()->shouldDumpAsAudio()) { |
634 const WebArrayBufferView* audio_data = | 634 std::vector<unsigned char> vector_data; |
635 interfaces->testRunner()->audioData(); | 635 interfaces->testRunner()->getAudioData(&vector_data); |
636 std::vector<unsigned char> vector_data( | |
637 static_cast<const unsigned char*>(audio_data->baseAddress()), | |
638 static_cast<const unsigned char*>(audio_data->baseAddress()) + | |
639 audio_data->byteLength()); | |
640 Send(new ShellViewHostMsg_AudioDump(routing_id(), vector_data)); | 636 Send(new ShellViewHostMsg_AudioDump(routing_id(), vector_data)); |
641 } else { | 637 } else { |
642 Send(new ShellViewHostMsg_TextDump(routing_id(), | 638 Send(new ShellViewHostMsg_TextDump(routing_id(), |
643 proxy()->captureTree(false))); | 639 proxy()->captureTree(false))); |
644 | 640 |
645 if (test_config_.enable_pixel_dumping && | 641 if (test_config_.enable_pixel_dumping && |
646 interfaces->testRunner()->shouldGeneratePixelResults()) { | 642 interfaces->testRunner()->shouldGeneratePixelResults()) { |
647 SkBitmap snapshot; | 643 SkBitmap snapshot; |
648 CopyCanvasToBitmap(proxy()->capturePixels(), &snapshot); | 644 CopyCanvasToBitmap(proxy()->capturePixels(), &snapshot); |
649 | 645 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); | 720 WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); |
725 DCHECK_EQ(GURL(kAboutBlankURL), GURL(main_frame->document().url())); | 721 DCHECK_EQ(GURL(kAboutBlankURL), GURL(main_frame->document().url())); |
726 DCHECK(!main_frame->isLoading()); | 722 DCHECK(!main_frame->isLoading()); |
727 | 723 |
728 LeakDetectionResult result = leak_detector_->TryLeakDetection( | 724 LeakDetectionResult result = leak_detector_->TryLeakDetection( |
729 render_view()->GetWebView()->mainFrame()); | 725 render_view()->GetWebView()->mainFrame()); |
730 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), result)); | 726 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), result)); |
731 } | 727 } |
732 | 728 |
733 } // namespace content | 729 } // namespace content |
OLD | NEW |