OLD | NEW |
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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
12 #include "base/strings/string_piece.h" | 12 #include "base/strings/string_piece.h" |
13 #include "media/audio/audio_manager.h" | 13 #include "media/audio/audio_manager.h" |
14 #include "media/audio/sounds/audio_stream_handler.h" | 14 #include "media/audio/sounds/audio_stream_handler.h" |
15 #include "media/audio/sounds/sounds_manager.h" | 15 #include "media/audio/sounds/sounds_manager.h" |
16 #include "media/audio/sounds/test_data.h" | 16 #include "media/audio/sounds/test_data.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 namespace media { | 19 namespace media { |
20 | 20 |
21 class SoundsManagerTest : public testing::Test { | 21 class SoundsManagerTest : public testing::Test { |
22 public: | 22 public: |
23 SoundsManagerTest() {} | 23 SoundsManagerTest() {} |
24 virtual ~SoundsManagerTest() {} | 24 virtual ~SoundsManagerTest() {} |
25 | 25 |
26 virtual void SetUp() OVERRIDE { | 26 virtual void SetUp() override { |
27 audio_manager_.reset(AudioManager::CreateForTesting()); | 27 audio_manager_.reset(AudioManager::CreateForTesting()); |
28 SoundsManager::Create(); | 28 SoundsManager::Create(); |
29 } | 29 } |
30 | 30 |
31 virtual void TearDown() OVERRIDE { | 31 virtual void TearDown() override { |
32 SoundsManager::Shutdown(); | 32 SoundsManager::Shutdown(); |
33 audio_manager_.reset(); | 33 audio_manager_.reset(); |
34 } | 34 } |
35 | 35 |
36 void SetObserverForTesting(AudioStreamHandler::TestObserver* observer) { | 36 void SetObserverForTesting(AudioStreamHandler::TestObserver* observer) { |
37 AudioStreamHandler::SetObserverForTesting(observer); | 37 AudioStreamHandler::SetObserverForTesting(observer); |
38 } | 38 } |
39 | 39 |
40 private: | 40 private: |
41 scoped_ptr<AudioManager> audio_manager_; | 41 scoped_ptr<AudioManager> audio_manager_; |
(...skipping 18 matching lines...) Expand all Loading... |
60 run_loop.Run(); | 60 run_loop.Run(); |
61 | 61 |
62 ASSERT_EQ(1, observer.num_play_requests()); | 62 ASSERT_EQ(1, observer.num_play_requests()); |
63 ASSERT_EQ(1, observer.num_stop_requests()); | 63 ASSERT_EQ(1, observer.num_stop_requests()); |
64 ASSERT_EQ(4, observer.cursor()); | 64 ASSERT_EQ(4, observer.cursor()); |
65 | 65 |
66 SetObserverForTesting(NULL); | 66 SetObserverForTesting(NULL); |
67 } | 67 } |
68 | 68 |
69 } // namespace media | 69 } // namespace media |
OLD | NEW |