| 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 "content/browser/renderer_host/media/media_stream_dispatcher_host.h" | 5 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 const int kProcessId = 5; | 56 const int kProcessId = 5; |
| 57 const int kRenderId = 6; | 57 const int kRenderId = 6; |
| 58 const int kPageRequestId = 7; | 58 const int kPageRequestId = 7; |
| 59 | 59 |
| 60 namespace content { | 60 namespace content { |
| 61 | 61 |
| 62 class MockMediaStreamDispatcherHost : public MediaStreamDispatcherHost, | 62 class MockMediaStreamDispatcherHost : public MediaStreamDispatcherHost, |
| 63 public TestContentBrowserClient { | 63 public TestContentBrowserClient { |
| 64 public: | 64 public: |
| 65 MockMediaStreamDispatcherHost( | 65 MockMediaStreamDispatcherHost( |
| 66 const ResourceContext::SaltCallback salt_callback, | 66 const std::string& salt, |
| 67 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 67 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 68 MediaStreamManager* manager) | 68 MediaStreamManager* manager) |
| 69 : MediaStreamDispatcherHost(kProcessId, salt_callback, manager, true), | 69 : MediaStreamDispatcherHost(kProcessId, salt, manager, true), |
| 70 task_runner_(task_runner), | 70 task_runner_(task_runner), |
| 71 current_ipc_(NULL) {} | 71 current_ipc_(NULL) {} |
| 72 | 72 |
| 73 // A list of mock methods. | 73 // A list of mock methods. |
| 74 MOCK_METHOD4(OnStreamGenerated, | 74 MOCK_METHOD4(OnStreamGenerated, |
| 75 void(int routing_id, int request_id, int audio_array_size, | 75 void(int routing_id, int request_id, int audio_array_size, |
| 76 int video_array_size)); | 76 int video_array_size)); |
| 77 MOCK_METHOD3(OnStreamGenerationFailed, void(int routing_id, | 77 MOCK_METHOD3(OnStreamGenerationFailed, void(int routing_id, |
| 78 int request_id, | 78 int request_id, |
| 79 MediaStreamRequestResult result)); | 79 MediaStreamRequestResult result)); |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 | 954 |
| 955 TEST_F(MediaStreamDispatcherHostTest, DeviceChangeNotification) { | 955 TEST_F(MediaStreamDispatcherHostTest, DeviceChangeNotification) { |
| 956 SetupFakeUI(false); | 956 SetupFakeUI(false); |
| 957 // warm up the cache | 957 // warm up the cache |
| 958 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId, | 958 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId, |
| 959 MEDIA_DEVICE_VIDEO_CAPTURE); | 959 MEDIA_DEVICE_VIDEO_CAPTURE); |
| 960 SubscribeToDeviceChangeNotificationsAndWaitForNotification(kRenderId); | 960 SubscribeToDeviceChangeNotificationsAndWaitForNotification(kRenderId); |
| 961 } | 961 } |
| 962 | 962 |
| 963 }; // namespace content | 963 }; // namespace content |
| OLD | NEW |