1 /*
2  * Copyright (C) 2012 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy of
6  * the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * License for the specific language governing permissions and limitations under
14  * the License.
15  */
16 #include <unistd.h>
17 
18 #include <gtest/gtest.h>
19 #include <utils/threads.h>
20 #include <utils/StrongPointer.h>
21 
22 #include <audio/AudioHardware.h>
23 #include <GenericFactory.h>
24 #include <audio/AudioRecordingLocal.h>
25 
26 #include <Log.h>
27 
28 #include "AudioPlayTestCommon.h"
29 
30 class AudioRecordingLocalTest : public AudioPlayTestCommon {
31 public:
~AudioRecordingLocalTest()32     virtual ~AudioRecordingLocalTest() {};
33 protected:
34 
createAudioHw()35     android::sp<AudioHardware> createAudioHw() {
36         return AudioHardware::createAudioHw(true, false);
37     }
38 };
39 
40 
TEST_F(AudioRecordingLocalTest,PlayAllTest)41 TEST_F(AudioRecordingLocalTest, PlayAllTest) {
42     playAll(1);
43 }
44 
TEST_F(AudioRecordingLocalTest,PlayAllRepeatTest)45 TEST_F(AudioRecordingLocalTest, PlayAllRepeatTest) {
46     playAll(4);
47 }
48 
TEST_F(AudioRecordingLocalTest,StartStopTest)49 TEST_F(AudioRecordingLocalTest, StartStopTest) {
50     repeatPlayStop();
51 }
52 
TEST_F(AudioRecordingLocalTest,WrongUsageTest)53 TEST_F(AudioRecordingLocalTest, WrongUsageTest) {
54     playWrongUsage();
55 }
56 
57