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

Side by Side Diff: media/audio/alsa/alsa_output_unittest.cc

Issue 2784433002: Ensures that audio tasks cannot run after AudioManager is deleted. (Closed)
Patch Set: fixes content_browsertests and content_unittests Created 3 years, 8 months 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 static char kSurround41[]; 171 static char kSurround41[];
172 static char kSurround50[]; 172 static char kSurround50[];
173 static char kSurround51[]; 173 static char kSurround51[];
174 static char kSurround70[]; 174 static char kSurround70[];
175 static char kSurround71[]; 175 static char kSurround71[];
176 static void* kFakeHints[]; 176 static void* kFakeHints[];
177 static char kGenericSurround50[]; 177 static char kGenericSurround50[];
178 178
179 base::TestMessageLoop message_loop_; 179 base::TestMessageLoop message_loop_;
180 StrictMock<MockAlsaWrapper> mock_alsa_wrapper_; 180 StrictMock<MockAlsaWrapper> mock_alsa_wrapper_;
181 std::unique_ptr<StrictMock<MockAudioManagerAlsa>, AudioManagerDeleter> 181 std::unique_ptr<StrictMock<MockAudioManagerAlsa>> mock_manager_;
182 mock_manager_;
183 scoped_refptr<DataBuffer> packet_; 182 scoped_refptr<DataBuffer> packet_;
184 183
185 private: 184 private:
186 DISALLOW_COPY_AND_ASSIGN(AlsaPcmOutputStreamTest); 185 DISALLOW_COPY_AND_ASSIGN(AlsaPcmOutputStreamTest);
187 }; 186 };
188 187
189 const ChannelLayout AlsaPcmOutputStreamTest::kTestChannelLayout = 188 const ChannelLayout AlsaPcmOutputStreamTest::kTestChannelLayout =
190 CHANNEL_LAYOUT_STEREO; 189 CHANNEL_LAYOUT_STEREO;
191 const int AlsaPcmOutputStreamTest::kTestSampleRate = 190 const int AlsaPcmOutputStreamTest::kTestSampleRate =
192 AudioParameters::kAudioCDSampleRate; 191 AudioParameters::kAudioCDSampleRate;
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 877
879 // TODO(ajwong): Find a way to test whether or not another task has been 878 // TODO(ajwong): Find a way to test whether or not another task has been
880 // posted so we can verify that the Alsa code will indeed break the task 879 // posted so we can verify that the Alsa code will indeed break the task
881 // posting loop. 880 // posting loop.
882 881
883 test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed); 882 test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed);
884 test_stream->Close(); 883 test_stream->Close();
885 } 884 }
886 885
887 } // namespace media 886 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698