| 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/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "content/browser/browser_thread_impl.h" | 9 #include "content/browser/browser_thread_impl.h" |
| 10 #include "content/browser/renderer_host/media/media_stream_ui_controller.h" | 10 #include "content/browser/renderer_host/media/media_stream_ui_controller.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 public: | 24 public: |
| 25 MediaStreamDeviceUIControllerTest() {} | 25 MediaStreamDeviceUIControllerTest() {} |
| 26 | 26 |
| 27 // Mock implementation of SettingsRequester; | 27 // Mock implementation of SettingsRequester; |
| 28 MOCK_METHOD2(DevicesAccepted, void( | 28 MOCK_METHOD2(DevicesAccepted, void( |
| 29 const std::string&, const StreamDeviceInfoArray&)); | 29 const std::string&, const StreamDeviceInfoArray&)); |
| 30 MOCK_METHOD1(SettingsError, void(const std::string&)); | 30 MOCK_METHOD1(SettingsError, void(const std::string&)); |
| 31 void GetAvailableDevices(MediaStreamDevices* devices) OVERRIDE { | 31 void GetAvailableDevices(MediaStreamDevices* devices) OVERRIDE { |
| 32 devices->push_back(MediaStreamDevice(MEDIA_DEVICE_AUDIO_CAPTURE, | 32 devices->push_back(MediaStreamDevice(MEDIA_DEVICE_AUDIO_CAPTURE, |
| 33 "mic", | 33 "mic", |
| 34 "mic_id")); | 34 "mic_id", |
| 35 0, |
| 36 0)); |
| 35 devices->push_back(MediaStreamDevice(MEDIA_DEVICE_VIDEO_CAPTURE, | 37 devices->push_back(MediaStreamDevice(MEDIA_DEVICE_VIDEO_CAPTURE, |
| 36 "camera", | 38 "camera", |
| 37 "camera_id")); | 39 "camera_id")); |
| 38 } | 40 } |
| 39 | 41 |
| 40 protected: | 42 protected: |
| 41 virtual void SetUp() { | 43 virtual void SetUp() { |
| 42 message_loop_.reset(new MessageLoop(MessageLoop::TYPE_IO)); | 44 message_loop_.reset(new MessageLoop(MessageLoop::TYPE_IO)); |
| 43 ui_thread_.reset(new BrowserThreadImpl(BrowserThread::UI, | 45 ui_thread_.reset(new BrowserThreadImpl(BrowserThread::UI, |
| 44 message_loop_.get())); | 46 message_loop_.get())); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 145 |
| 144 // Remove the last request which is pending in the queue. | 146 // Remove the last request which is pending in the queue. |
| 145 ui_controller_->CancelUIRequest(label_3); | 147 ui_controller_->CancelUIRequest(label_3); |
| 146 | 148 |
| 147 // We should get callbacks from the rest of the requests. | 149 // We should get callbacks from the rest of the requests. |
| 148 EXPECT_CALL(*this, DevicesAccepted(label_1, _)); | 150 EXPECT_CALL(*this, DevicesAccepted(label_1, _)); |
| 149 EXPECT_CALL(*this, DevicesAccepted(label_2, _)); | 151 EXPECT_CALL(*this, DevicesAccepted(label_2, _)); |
| 150 } | 152 } |
| 151 | 153 |
| 152 } // namespace content | 154 } // namespace content |
| OLD | NEW |