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

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

Issue 670683003: Standardize usage of virtual/override/final in content/renderer/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/child/child_process.h" 9 #include "content/child/child_process.h"
10 #include "content/common/media/video_capture.h" 10 #include "content/common/media/video_capture.h"
11 #include "content/public/renderer/media_stream_video_sink.h" 11 #include "content/public/renderer/media_stream_video_sink.h"
12 #include "content/renderer/media/media_stream.h" 12 #include "content/renderer/media/media_stream.h"
13 #include "content/renderer/media/media_stream_registry_interface.h" 13 #include "content/renderer/media/media_stream_registry_interface.h"
14 #include "content/renderer/media/mock_media_stream_registry.h" 14 #include "content/renderer/media/mock_media_stream_registry.h"
15 #include "content/renderer/media/video_source_handler.h" 15 #include "content/renderer/media/video_source_handler.h"
16 #include "testing/gmock/include/gmock/gmock.h" 16 #include "testing/gmock/include/gmock/gmock.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" 18 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
19 #include "third_party/WebKit/public/platform/WebString.h" 19 #include "third_party/WebKit/public/platform/WebString.h"
20 #include "third_party/WebKit/public/web/WebHeap.h" 20 #include "third_party/WebKit/public/web/WebHeap.h"
21 21
22 namespace content { 22 namespace content {
23 23
24 static const std::string kTestStreamUrl = "stream_url"; 24 static const std::string kTestStreamUrl = "stream_url";
25 static const std::string kTestVideoTrackId = "video_track_id"; 25 static const std::string kTestVideoTrackId = "video_track_id";
26 static const std::string kUnknownStreamUrl = "unknown_stream_url"; 26 static const std::string kUnknownStreamUrl = "unknown_stream_url";
27 27
28 class FakeFrameReader : public FrameReaderInterface { 28 class FakeFrameReader : public FrameReaderInterface {
29 public: 29 public:
30 virtual void GotFrame( 30 void GotFrame(const scoped_refptr<media::VideoFrame>& frame) override {
31 const scoped_refptr<media::VideoFrame>& frame) override {
32 last_frame_ = frame; 31 last_frame_ = frame;
33 } 32 }
34 33
35 const media::VideoFrame* last_frame() { 34 const media::VideoFrame* last_frame() {
36 return last_frame_.get(); 35 return last_frame_.get();
37 } 36 }
38 37
39 private: 38 private:
40 scoped_refptr<media::VideoFrame> last_frame_; 39 scoped_refptr<media::VideoFrame> last_frame_;
41 }; 40 };
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 EXPECT_FALSE(handler_->Close(NULL)); 92 EXPECT_FALSE(handler_->Close(NULL));
94 EXPECT_TRUE(handler_->Close(&reader)); 93 EXPECT_TRUE(handler_->Close(&reader));
95 } 94 }
96 95
97 TEST_F(VideoSourceHandlerTest, OpenWithoutClose) { 96 TEST_F(VideoSourceHandlerTest, OpenWithoutClose) {
98 FakeFrameReader reader; 97 FakeFrameReader reader;
99 EXPECT_TRUE(handler_->Open(kTestStreamUrl, &reader)); 98 EXPECT_TRUE(handler_->Open(kTestStreamUrl, &reader));
100 } 99 }
101 100
102 } // namespace content 101 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/video_source_handler.cc ('k') | content/renderer/media/webmediaplayer_ms.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698