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

Side by Side Diff: media/audio/android/audio_android_unittest.cc

Issue 1211273005: Use safer IPC serializations in media_param_traits.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up unit tests Created 5 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
« no previous file with comments | « media/audio/alsa/alsa_output_unittest.cc ('k') | media/audio/audio_parameters.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 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 "base/android/build_info.h" 5 #include "base/android/build_info.h"
6 #include "base/basictypes.h" 6 #include "base/basictypes.h"
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 // Converts AudioParameters::Format enumerator to readable string. 54 // Converts AudioParameters::Format enumerator to readable string.
55 static std::string FormatToString(AudioParameters::Format format) { 55 static std::string FormatToString(AudioParameters::Format format) {
56 switch (format) { 56 switch (format) {
57 case AudioParameters::AUDIO_PCM_LINEAR: 57 case AudioParameters::AUDIO_PCM_LINEAR:
58 return std::string("AUDIO_PCM_LINEAR"); 58 return std::string("AUDIO_PCM_LINEAR");
59 case AudioParameters::AUDIO_PCM_LOW_LATENCY: 59 case AudioParameters::AUDIO_PCM_LOW_LATENCY:
60 return std::string("AUDIO_PCM_LOW_LATENCY"); 60 return std::string("AUDIO_PCM_LOW_LATENCY");
61 case AudioParameters::AUDIO_FAKE: 61 case AudioParameters::AUDIO_FAKE:
62 return std::string("AUDIO_FAKE"); 62 return std::string("AUDIO_FAKE");
63 case AudioParameters::AUDIO_LAST_FORMAT:
64 return std::string("AUDIO_LAST_FORMAT");
65 default: 63 default:
66 return std::string(); 64 return std::string();
67 } 65 }
68 } 66 }
69 67
70 // Converts ChannelLayout enumerator to readable string. Does not include 68 // Converts ChannelLayout enumerator to readable string. Does not include
71 // multi-channel cases since these layouts are not supported on Android. 69 // multi-channel cases since these layouts are not supported on Android.
72 static std::string LayoutToString(ChannelLayout channel_layout) { 70 static std::string LayoutToString(ChannelLayout channel_layout) {
73 switch (channel_layout) { 71 switch (channel_layout) {
74 case CHANNEL_LAYOUT_NONE: 72 case CHANNEL_LAYOUT_NONE:
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20)); 962 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20));
965 printf("\n"); 963 printf("\n");
966 StopAndCloseAudioOutputStreamOnAudioThread(); 964 StopAndCloseAudioOutputStreamOnAudioThread();
967 StopAndCloseAudioInputStreamOnAudioThread(); 965 StopAndCloseAudioInputStreamOnAudioThread();
968 } 966 }
969 967
970 INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest, 968 INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest,
971 testing::ValuesIn(RunAudioRecordInputPathTests())); 969 testing::ValuesIn(RunAudioRecordInputPathTests()));
972 970
973 } // namespace media 971 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/alsa/alsa_output_unittest.cc ('k') | media/audio/audio_parameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698