Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Side by Side Diff: content/shell/renderer/webkit_test_runner.cc

Issue 185263006: Move TestRunner from CppVariable to gin::Wrappable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Bug fix: text_runner -> test_runner in gypi :-( Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/shell/renderer/test_runner/text_input_controller.h ('k') | gin/arguments.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/shell/renderer/test_runner/text_input_controller.h ('k') | gin/arguments.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698