OLD | NEW |
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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 media::FakeAudioLogFactory fake_audio_log_factory_; | 72 media::FakeAudioLogFactory fake_audio_log_factory_; |
73 DISALLOW_COPY_AND_ASSIGN(MockAudioManager); | 73 DISALLOW_COPY_AND_ASSIGN(MockAudioManager); |
74 }; | 74 }; |
75 | 75 |
76 class MediaStreamManagerTest : public ::testing::Test { | 76 class MediaStreamManagerTest : public ::testing::Test { |
77 public: | 77 public: |
78 MediaStreamManagerTest() | 78 MediaStreamManagerTest() |
79 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), | 79 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), |
80 message_loop_(base::MessageLoopProxy::current()) { | 80 message_loop_(base::MessageLoopProxy::current()) { |
81 // Create our own MediaStreamManager. Use fake devices to run on the bots. | 81 // Create our own MediaStreamManager. Use fake devices to run on the bots. |
82 CommandLine::ForCurrentProcess()->AppendSwitch( | 82 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
83 switches::kUseFakeDeviceForMediaStream); | 83 switches::kUseFakeDeviceForMediaStream); |
84 audio_manager_.reset(new MockAudioManager()); | 84 audio_manager_.reset(new MockAudioManager()); |
85 media_stream_manager_.reset(new MediaStreamManager(audio_manager_.get())); | 85 media_stream_manager_.reset(new MediaStreamManager(audio_manager_.get())); |
86 } | 86 } |
87 | 87 |
88 virtual ~MediaStreamManagerTest() { | 88 virtual ~MediaStreamManagerTest() { |
89 } | 89 } |
90 | 90 |
91 MOCK_METHOD1(Response, void(int index)); | 91 MOCK_METHOD1(Response, void(int index)); |
92 void ResponseCallback(int index, | 92 void ResponseCallback(int index, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 std::string label2 = MakeMediaAccessRequest(1); | 174 std::string label2 = MakeMediaAccessRequest(1); |
175 media_stream_manager_->CancelRequest(label1); | 175 media_stream_manager_->CancelRequest(label1); |
176 | 176 |
177 // Expecting the callback from the second request will be triggered and | 177 // Expecting the callback from the second request will be triggered and |
178 // quit the test. | 178 // quit the test. |
179 EXPECT_CALL(*this, Response(1)); | 179 EXPECT_CALL(*this, Response(1)); |
180 run_loop_.Run(); | 180 run_loop_.Run(); |
181 } | 181 } |
182 | 182 |
183 } // namespace content | 183 } // namespace content |
OLD | NEW |