OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "content/child/child_process.h" | 8 #include "content/child/child_process.h" |
9 #include "content/renderer/media/media_stream_video_capturer_source.h" | 9 #include "content/renderer/media/media_stream_video_capturer_source.h" |
10 #include "content/renderer/media/media_stream_video_track.h" | 10 #include "content/renderer/media/media_stream_video_track.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 | 63 |
64 MockVideoCapturerDelegate& mock_delegate() { | 64 MockVideoCapturerDelegate& mock_delegate() { |
65 return *static_cast<MockVideoCapturerDelegate*>(delegate_.get()); | 65 return *static_cast<MockVideoCapturerDelegate*>(delegate_.get()); |
66 } | 66 } |
67 | 67 |
68 protected: | 68 protected: |
69 void OnConstraintsApplied(MediaStreamSource* source, bool success) { | 69 void OnConstraintsApplied(MediaStreamSource* source, bool success) { |
70 } | 70 } |
71 | 71 |
72 base::MessageLoop message_loop_; | 72 base::MessageLoopForUI message_loop_; |
73 scoped_ptr<ChildProcess> child_process_; | 73 scoped_ptr<ChildProcess> child_process_; |
74 blink::WebMediaStreamSource webkit_source_; | 74 blink::WebMediaStreamSource webkit_source_; |
75 MediaStreamVideoCapturerSource* source_; // owned by webkit_source. | 75 MediaStreamVideoCapturerSource* source_; // owned by webkit_source. |
76 scoped_refptr<VideoCapturerDelegate> delegate_; | 76 scoped_refptr<VideoCapturerDelegate> delegate_; |
77 }; | 77 }; |
78 | 78 |
79 TEST_F(MediaStreamVideoCapturerSourceTest, TabCaptureAllowResolutionChange) { | 79 TEST_F(MediaStreamVideoCapturerSourceTest, TabCaptureAllowResolutionChange) { |
80 StreamDeviceInfo device_info; | 80 StreamDeviceInfo device_info; |
81 device_info.device.type = MEDIA_TAB_VIDEO_CAPTURE; | 81 device_info.device.type = MEDIA_TAB_VIDEO_CAPTURE; |
82 InitWithDeviceInfo(device_info); | 82 InitWithDeviceInfo(device_info); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateLive, | 125 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateLive, |
126 webkit_source_.readyState()); | 126 webkit_source_.readyState()); |
127 | 127 |
128 delegate_->OnStateUpdateOnRenderThread(VIDEO_CAPTURE_STATE_ERROR); | 128 delegate_->OnStateUpdateOnRenderThread(VIDEO_CAPTURE_STATE_ERROR); |
129 message_loop_.RunUntilIdle(); | 129 message_loop_.RunUntilIdle(); |
130 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, | 130 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, |
131 webkit_source_.readyState()); | 131 webkit_source_.readyState()); |
132 } | 132 } |
133 | 133 |
134 } // namespace content | 134 } // namespace content |
OLD | NEW |