| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/atomicops.h" | 7 #include "base/atomicops.h" |
| 8 #include "base/synchronization/lock.h" | 8 #include "base/synchronization/lock.h" |
| 9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
| 10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 DISALLOW_COPY_AND_ASSIGN(FakeMediaStreamAudioSink); | 235 DISALLOW_COPY_AND_ASSIGN(FakeMediaStreamAudioSink); |
| 236 }; | 236 }; |
| 237 | 237 |
| 238 } // namespace | 238 } // namespace |
| 239 | 239 |
| 240 class MediaStreamAudioTest : public ::testing::Test { | 240 class MediaStreamAudioTest : public ::testing::Test { |
| 241 protected: | 241 protected: |
| 242 void SetUp() override { | 242 void SetUp() override { |
| 243 blink_audio_source_.initialize(blink::WebString::fromUTF8("audio_id"), | 243 blink_audio_source_.initialize(blink::WebString::fromUTF8("audio_id"), |
| 244 blink::WebMediaStreamSource::TypeAudio, | 244 blink::WebMediaStreamSource::TypeAudio, |
| 245 blink::WebString::fromUTF8("audio_track"), | 245 blink::WebString::fromUTF8("audio_track")); |
| 246 false /* remote */); | |
| 247 blink_audio_track_.initialize(blink_audio_source_.id(), | 246 blink_audio_track_.initialize(blink_audio_source_.id(), |
| 248 blink_audio_source_); | 247 blink_audio_source_); |
| 249 } | 248 } |
| 250 | 249 |
| 251 void TearDown() override { | 250 void TearDown() override { |
| 252 blink_audio_track_.reset(); | 251 blink_audio_track_.reset(); |
| 253 blink_audio_source_.reset(); | 252 blink_audio_source_.reset(); |
| 254 blink::WebHeap::collectAllGarbageForTesting(); | 253 blink::WebHeap::collectAllGarbageForTesting(); |
| 255 } | 254 } |
| 256 | 255 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 // enabled state of the second track and sink. They should still be disabled, | 443 // enabled state of the second track and sink. They should still be disabled, |
| 445 // with silent audio being consumed at the sink. | 444 // with silent audio being consumed at the sink. |
| 446 EXPECT_EQ(FakeMediaStreamAudioSink::WAS_DISABLED, sink.enable_state()); | 445 EXPECT_EQ(FakeMediaStreamAudioSink::WAS_DISABLED, sink.enable_state()); |
| 447 EXPECT_TRUE(sink.is_audio_silent()); | 446 EXPECT_TRUE(sink.is_audio_silent()); |
| 448 | 447 |
| 449 MediaStreamAudioTrack::From(another_blink_track)->RemoveSink(&another_sink); | 448 MediaStreamAudioTrack::From(another_blink_track)->RemoveSink(&another_sink); |
| 450 track()->RemoveSink(&sink); | 449 track()->RemoveSink(&sink); |
| 451 } | 450 } |
| 452 | 451 |
| 453 } // namespace content | 452 } // namespace content |
| OLD | NEW |