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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 class AudioOutputControllerTest : public testing::Test { | 94 class AudioOutputControllerTest : public testing::Test { |
95 public: | 95 public: |
96 AudioOutputControllerTest() | 96 AudioOutputControllerTest() |
97 : audio_manager_(AudioManager::CreateForTesting()), | 97 : audio_manager_(AudioManager::CreateForTesting()), |
98 create_event_(false, false), | 98 create_event_(false, false), |
99 play_event_(false, false), | 99 play_event_(false, false), |
100 read_event_(false, false), | 100 read_event_(false, false), |
101 pause_event_(false, false) { | 101 pause_event_(false, false) { |
102 } | 102 } |
103 | 103 |
104 ~AudioOutputControllerTest() override {} | 104 ~AudioOutputControllerTest() override { |
| 105 AudioManager::Destroy(audio_manager_.release()); |
| 106 } |
105 | 107 |
106 protected: | 108 protected: |
107 void Create(int samples_per_packet) { | 109 void Create(int samples_per_packet) { |
108 EXPECT_FALSE(create_event_.IsSignaled()); | 110 EXPECT_FALSE(create_event_.IsSignaled()); |
109 EXPECT_FALSE(play_event_.IsSignaled()); | 111 EXPECT_FALSE(play_event_.IsSignaled()); |
110 EXPECT_FALSE(read_event_.IsSignaled()); | 112 EXPECT_FALSE(read_event_.IsSignaled()); |
111 EXPECT_FALSE(pause_event_.IsSignaled()); | 113 EXPECT_FALSE(pause_event_.IsSignaled()); |
112 | 114 |
113 params_ = AudioParameters( | 115 params_ = AudioParameters( |
114 AudioParameters::AUDIO_FAKE, kChannelLayout, | 116 AudioParameters::AUDIO_FAKE, kChannelLayout, |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 | 407 |
406 TEST_F(AudioOutputControllerTest, DivertRevertClose) { | 408 TEST_F(AudioOutputControllerTest, DivertRevertClose) { |
407 Create(kSamplesPerPacket); | 409 Create(kSamplesPerPacket); |
408 WaitForCreate(); | 410 WaitForCreate(); |
409 DivertNeverPlaying(); | 411 DivertNeverPlaying(); |
410 RevertWasNotPlaying(); | 412 RevertWasNotPlaying(); |
411 Close(); | 413 Close(); |
412 } | 414 } |
413 | 415 |
414 } // namespace media | 416 } // namespace media |
OLD | NEW |