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

Side by Side Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 19023003: Use a mock WebAudioDevice for layout tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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
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/renderer/renderer_webkitplatformsupport_impl.h" 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 } 773 }
774 774
775 WebAudioDevice* 775 WebAudioDevice*
776 RendererWebKitPlatformSupportImpl::createAudioDevice( 776 RendererWebKitPlatformSupportImpl::createAudioDevice(
777 size_t buffer_size, 777 size_t buffer_size,
778 unsigned input_channels, 778 unsigned input_channels,
779 unsigned channels, 779 unsigned channels,
780 double sample_rate, 780 double sample_rate,
781 WebAudioDevice::RenderCallback* callback, 781 WebAudioDevice::RenderCallback* callback,
782 const WebKit::WebString& input_device_id) { 782 const WebKit::WebString& input_device_id) {
783 // Use a mock for testing.
784 WebKit::WebAudioDevice* mock_device =
785 GetContentClient()->renderer()->OverrideCreateAudioDevice(sample_rate);
786 if (mock_device)
787 return mock_device;
788
783 // The |channels| does not exactly identify the channel layout of the 789 // The |channels| does not exactly identify the channel layout of the
784 // device. The switch statement below assigns a best guess to the channel 790 // device. The switch statement below assigns a best guess to the channel
785 // layout based on number of channels. 791 // layout based on number of channels.
786 // TODO(crogers): WebKit should give the channel layout instead of the hard 792 // TODO(crogers): WebKit should give the channel layout instead of the hard
787 // channel count. 793 // channel count.
788 media::ChannelLayout layout = media::CHANNEL_LAYOUT_UNSUPPORTED; 794 media::ChannelLayout layout = media::CHANNEL_LAYOUT_UNSUPPORTED;
789 switch (channels) { 795 switch (channels) {
790 case 1: 796 case 1:
791 layout = media::CHANNEL_LAYOUT_MONO; 797 layout = media::CHANNEL_LAYOUT_MONO;
792 break; 798 break;
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 1056
1051 //------------------------------------------------------------------------------ 1057 //------------------------------------------------------------------------------
1052 1058
1053 WebKit::WebString RendererWebKitPlatformSupportImpl::convertIDNToUnicode( 1059 WebKit::WebString RendererWebKitPlatformSupportImpl::convertIDNToUnicode(
1054 const WebKit::WebString& host, 1060 const WebKit::WebString& host,
1055 const WebKit::WebString& languages) { 1061 const WebKit::WebString& languages) {
1056 return net::IDNToUnicode(host.utf8(), languages.utf8()); 1062 return net::IDNToUnicode(host.utf8(), languages.utf8());
1057 } 1063 }
1058 1064
1059 } // namespace content 1065 } // namespace content
OLDNEW
« no previous file with comments | « content/public/renderer/content_renderer_client.cc ('k') | content/shell/renderer/shell_content_renderer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698