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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 gfx::Size(352, 288), 30, media::PIXEL_FORMAT_I420)); | 49 gfx::Size(352, 288), 30, media::PIXEL_FORMAT_I420)); |
50 formats.push_back(media::VideoCaptureFormat( | 50 formats.push_back(media::VideoCaptureFormat( |
51 gfx::Size(320, 240), 30, media::PIXEL_FORMAT_I420)); | 51 gfx::Size(320, 240), 30, media::PIXEL_FORMAT_I420)); |
52 mock_source_->SetSupportedFormats(formats); | 52 mock_source_->SetSupportedFormats(formats); |
53 webkit_source_.initialize(base::UTF8ToUTF16("dummy_source_id"), | 53 webkit_source_.initialize(base::UTF8ToUTF16("dummy_source_id"), |
54 blink::WebMediaStreamSource::TypeVideo, | 54 blink::WebMediaStreamSource::TypeVideo, |
55 base::UTF8ToUTF16("dummy_source_name")); | 55 base::UTF8ToUTF16("dummy_source_name")); |
56 webkit_source_.setExtraData(mock_source_); | 56 webkit_source_.setExtraData(mock_source_); |
57 } | 57 } |
58 | 58 |
59 virtual void TearDown() { | 59 void TearDown() override { |
60 webkit_source_.reset(); | 60 webkit_source_.reset(); |
61 blink::WebHeap::collectAllGarbageForTesting(); | 61 blink::WebHeap::collectAllGarbageForTesting(); |
62 } | 62 } |
63 | 63 |
64 protected: | 64 protected: |
65 // Create a track that's associated with |webkit_source_|. | 65 // Create a track that's associated with |webkit_source_|. |
66 blink::WebMediaStreamTrack CreateTrack( | 66 blink::WebMediaStreamTrack CreateTrack( |
67 const std::string& id, | 67 const std::string& id, |
68 const blink::WebMediaConstraints& constraints) { | 68 const blink::WebMediaConstraints& constraints) { |
69 bool enabled = true; | 69 bool enabled = true; |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 run_loop2.Run(); | 787 run_loop2.Run(); |
788 | 788 |
789 EXPECT_EQ(muted_state, false); | 789 EXPECT_EQ(muted_state, false); |
790 EXPECT_EQ(track.source().readyState(), | 790 EXPECT_EQ(track.source().readyState(), |
791 blink::WebMediaStreamSource::ReadyStateLive); | 791 blink::WebMediaStreamSource::ReadyStateLive); |
792 | 792 |
793 MediaStreamVideoSink::RemoveFromVideoTrack(&sink, track); | 793 MediaStreamVideoSink::RemoveFromVideoTrack(&sink, track); |
794 } | 794 } |
795 | 795 |
796 } // namespace content | 796 } // namespace content |
OLD | NEW |