| 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 <limits> | 5 #include <limits> |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "media/audio/audio_parameters.h" | 10 #include "media/audio/audio_parameters.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 EXPECT_EQ(2, source.callbacks()); | 62 EXPECT_EQ(2, source.callbacks()); |
| 63 source.Reset(); | 63 source.Reset(); |
| 64 EXPECT_EQ(source.OnMoreData( | 64 EXPECT_EQ(source.OnMoreData( |
| 65 audio_bus.get(), AudioBuffersState()), kSampleCap); | 65 audio_bus.get(), AudioBuffersState()), kSampleCap); |
| 66 EXPECT_EQ(3, source.callbacks()); | 66 EXPECT_EQ(3, source.callbacks()); |
| 67 EXPECT_EQ(0, source.errors()); | 67 EXPECT_EQ(0, source.errors()); |
| 68 } | 68 } |
| 69 | 69 |
| 70 TEST(SimpleSources, OnError) { | 70 TEST(SimpleSources, OnError) { |
| 71 SineWaveAudioSource source(1, 200, AudioParameters::kTelephoneSampleRate); | 71 SineWaveAudioSource source(1, 200, AudioParameters::kTelephoneSampleRate); |
| 72 source.OnError(NULL, 0); | 72 source.OnError(NULL); |
| 73 EXPECT_EQ(1, source.errors()); | 73 EXPECT_EQ(1, source.errors()); |
| 74 source.OnError(NULL, 0); | 74 source.OnError(NULL); |
| 75 EXPECT_EQ(2, source.errors()); | 75 EXPECT_EQ(2, source.errors()); |
| 76 } | 76 } |
| 77 | 77 |
| 78 } // namespace media | 78 } // namespace media |
| OLD | NEW |