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

Side by Side Diff: media/audio/audio_output_proxy_unittest.cc

Issue 2507643002: Removes tracking for fake audio streams. (Closed)
Patch Set: Created 4 years, 1 month 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/audio_manager_base.cc ('k') | media/audio/fake_audio_input_stream.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 (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 <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // Let start run long enough for many OnMoreData callbacks to occur. 50 // Let start run long enough for many OnMoreData callbacks to occur.
51 static const int kStartRunTimeMs = kOnMoreDataCallbackDelayMs * 10; 51 static const int kStartRunTimeMs = kOnMoreDataCallbackDelayMs * 10;
52 52
53 class MockAudioOutputStream : public AudioOutputStream { 53 class MockAudioOutputStream : public AudioOutputStream {
54 public: 54 public:
55 MockAudioOutputStream(AudioManagerBase* manager, 55 MockAudioOutputStream(AudioManagerBase* manager,
56 const AudioParameters& params) 56 const AudioParameters& params)
57 : start_called_(false), 57 : start_called_(false),
58 stop_called_(false), 58 stop_called_(false),
59 params_(params), 59 params_(params),
60 fake_output_stream_( 60 fake_output_stream_(FakeAudioOutputStream::MakeFakeStream(
61 FakeAudioOutputStream::MakeFakeStream(manager, params_)) { 61 manager->GetTaskRunner(),
62 } 62 manager->GetWorkerTaskRunner(),
63 params_)) {}
63 64
64 void Start(AudioSourceCallback* callback) { 65 void Start(AudioSourceCallback* callback) {
65 start_called_ = true; 66 start_called_ = true;
66 fake_output_stream_->Start(callback); 67 fake_output_stream_->Start(callback);
67 } 68 }
68 69
69 void Stop() { 70 void Stop() {
70 stop_called_ = true; 71 stop_called_ = true;
71 fake_output_stream_->Stop(); 72 fake_output_stream_->Stop();
72 } 73 }
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 .WillOnce(Return(&real_stream)); 742 .WillOnce(Return(&real_stream));
742 743
743 // Stream1 should be able to successfully open and start. 744 // Stream1 should be able to successfully open and start.
744 EXPECT_CALL(real_stream, Open()).WillOnce(Return(true)); 745 EXPECT_CALL(real_stream, Open()).WillOnce(Return(true));
745 proxy = new AudioOutputProxy(resampler_.get()); 746 proxy = new AudioOutputProxy(resampler_.get());
746 EXPECT_TRUE(proxy->Open()); 747 EXPECT_TRUE(proxy->Open());
747 CloseAndWaitForCloseTimer(proxy, &real_stream); 748 CloseAndWaitForCloseTimer(proxy, &real_stream);
748 } 749 }
749 750
750 } // namespace media 751 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/audio_manager_base.cc ('k') | media/audio/fake_audio_input_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698