Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: content/renderer/media/media_stream_video_capturer_source_unittest.cc

Issue 2432373003: Follow up: stop mirroring session when tab is closed. (Closed)
Patch Set: Fix unittests. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/media/media_stream_video_capturer_source.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/renderer/media/media_stream_video_capturer_source.h" 5 #include "content/renderer/media/media_stream_video_capturer_source.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 MockVideoCapturerSource& mock_delegate() { return *delegate_; } 106 MockVideoCapturerSource& mock_delegate() { return *delegate_; }
107 107
108 const char* GetPowerLineFrequencyForTesting() const { 108 const char* GetPowerLineFrequencyForTesting() const {
109 return source_->GetPowerLineFrequencyForTesting(); 109 return source_->GetPowerLineFrequencyForTesting();
110 } 110 }
111 111
112 void OnSourceStopped(const blink::WebMediaStreamSource& source) { 112 void OnSourceStopped(const blink::WebMediaStreamSource& source) {
113 source_stopped_ = true; 113 source_stopped_ = true;
114 EXPECT_EQ(source.id(), webkit_source_id_); 114 EXPECT_EQ(source.id(), webkit_source_id_);
115 } 115 }
116 void OnStarted(bool result) { source_->OnStarted(result); } 116 void OnStarted(bool result) { source_->OnRunStateChanged(result); }
117 117
118 protected: 118 protected:
119 void OnConstraintsApplied(MediaStreamSource* source, 119 void OnConstraintsApplied(MediaStreamSource* source,
120 MediaStreamRequestResult result, 120 MediaStreamRequestResult result,
121 const blink::WebString& result_name) {} 121 const blink::WebString& result_name) {}
122 122
123 // A ChildProcess and a MessageLoopForUI are both needed to fool the Tracks 123 // A ChildProcess and a MessageLoopForUI are both needed to fool the Tracks
124 // and Sources below into believing they are on the right threads. 124 // and Sources below into believing they are on the right threads.
125 base::MessageLoopForUI message_loop_; 125 base::MessageLoopForUI message_loop_;
126 std::unique_ptr<ChildProcess> child_process_; 126 std::unique_ptr<ChildProcess> child_process_;
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 run_loop.Run(); 396 run_loop.Run();
397 fake_sink.DisconnectFromTrack(); 397 fake_sink.DisconnectFromTrack();
398 EXPECT_EQ(reference_capture_time, capture_time); 398 EXPECT_EQ(reference_capture_time, capture_time);
399 double metadata_value; 399 double metadata_value;
400 EXPECT_TRUE(metadata.GetDouble(media::VideoFrameMetadata::FRAME_RATE, 400 EXPECT_TRUE(metadata.GetDouble(media::VideoFrameMetadata::FRAME_RATE,
401 &metadata_value)); 401 &metadata_value));
402 EXPECT_EQ(30.0, metadata_value); 402 EXPECT_EQ(30.0, metadata_value);
403 } 403 }
404 404
405 } // namespace content 405 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_video_capturer_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698