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
3 // found in the LICENSE file.
5 #ifndef MEDIA_AUDIO_SOUNDS_TEST_UTILS_H_
6 #define MEDIA_AUDIO_SOUNDS_TEST_UTILS_H_
8 #include "base/basictypes.h"
9 #include "base/callback.h"
10 #include "base/compiler_specific.h"
11 #include "media/audio/sounds/audio_stream_handler.h"
19 const char kTestAudioData[] = "RIFF\x26\x00\x00\x00WAVEfmt \x10\x00\x00\x00"
20 "\x01\x00\x02\x00\x80\xbb\x00\x00\x00\x77\x01\x00\x02\x00\x10\x00"
21 "data\x04\x00\x00\x00\x01\x00\x01\x00";
23 class TestObserver : public AudioStreamHandler::TestObserver {
25 TestObserver(const base::Closure& quit);
26 virtual ~TestObserver();
28 // AudioStreamHandler::TestObserver implementation:
29 virtual void OnPlay() OVERRIDE;
30 virtual void OnStop(size_t cursor) OVERRIDE;
32 int num_play_requests() const { return num_play_requests_; }
33 int num_stop_requests() const { return num_stop_requests_; }
34 int cursor() const { return cursor_; }
37 base::MessageLoop* loop_;
40 int num_play_requests_;
41 int num_stop_requests_;
44 DISALLOW_COPY_AND_ASSIGN(TestObserver);
49 #endif // MEDIA_AUDIO_SOUNDS_TEST_UTILS_H_