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

Side by Side Diff: media/audio/sounds/test_data.h

Issue 2076423004: Remove calls to MessageLoop::current() in media. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR Created 4 years, 5 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
« no previous file with comments | « media/audio/alsa/alsa_output.cc ('k') | media/audio/sounds/test_data.cc » ('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 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 #ifndef MEDIA_AUDIO_SOUNDS_TEST_DATA_H_ 5 #ifndef MEDIA_AUDIO_SOUNDS_TEST_DATA_H_
6 #define MEDIA_AUDIO_SOUNDS_TEST_DATA_H_ 6 #define MEDIA_AUDIO_SOUNDS_TEST_DATA_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h"
14 #include "base/single_thread_task_runner.h"
13 #include "media/audio/sounds/audio_stream_handler.h" 15 #include "media/audio/sounds/audio_stream_handler.h"
14 16
15 namespace base {
16 class MessageLoop;
17 }
18
19 namespace media { 17 namespace media {
20 18
21 const int kTestAudioKey = 1000; 19 const int kTestAudioKey = 1000;
22 20
23 const char kTestAudioData[] = 21 const char kTestAudioData[] =
24 "RIFF\x28\x00\x00\x00WAVEfmt \x10\x00\x00\x00" 22 "RIFF\x28\x00\x00\x00WAVEfmt \x10\x00\x00\x00"
25 "\x01\x00\x02\x00\x80\xbb\x00\x00\x00\x77\x01\x00\x02\x00\x10\x00" 23 "\x01\x00\x02\x00\x80\xbb\x00\x00\x00\x77\x01\x00\x02\x00\x10\x00"
26 "data\x04\x00\x00\x00\x01\x00\x01\x00"; 24 "data\x04\x00\x00\x00\x01\x00\x01\x00";
27 const size_t kTestAudioDataSize = arraysize(kTestAudioData) - 1; 25 const size_t kTestAudioDataSize = arraysize(kTestAudioData) - 1;
28 26
29 class TestObserver : public AudioStreamHandler::TestObserver { 27 class TestObserver : public AudioStreamHandler::TestObserver {
30 public: 28 public:
31 TestObserver(const base::Closure& quit); 29 TestObserver(const base::Closure& quit);
32 ~TestObserver() override; 30 ~TestObserver() override;
33 31
34 // AudioStreamHandler::TestObserver implementation: 32 // AudioStreamHandler::TestObserver implementation:
35 void OnPlay() override; 33 void OnPlay() override;
36 void OnStop(size_t cursor) override; 34 void OnStop(size_t cursor) override;
37 35
38 int num_play_requests() const { return num_play_requests_; } 36 int num_play_requests() const { return num_play_requests_; }
39 int num_stop_requests() const { return num_stop_requests_; } 37 int num_stop_requests() const { return num_stop_requests_; }
40 int cursor() const { return cursor_; } 38 int cursor() const { return cursor_; }
41 39
42 private: 40 private:
43 base::MessageLoop* loop_; 41 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
44 base::Closure quit_; 42 base::Closure quit_;
45 43
46 int num_play_requests_; 44 int num_play_requests_;
47 int num_stop_requests_; 45 int num_stop_requests_;
48 int cursor_; 46 int cursor_;
49 47
50 DISALLOW_COPY_AND_ASSIGN(TestObserver); 48 DISALLOW_COPY_AND_ASSIGN(TestObserver);
51 }; 49 };
52 50
53 } // namespace media 51 } // namespace media
54 52
55 #endif // MEDIA_AUDIO_SOUNDS_TEST_DATA_H_ 53 #endif // MEDIA_AUDIO_SOUNDS_TEST_DATA_H_
OLDNEW
« no previous file with comments | « media/audio/alsa/alsa_output.cc ('k') | media/audio/sounds/test_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698