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

Side by Side Diff: media/mojo/services/renderer_unittest.cc

Issue 655713003: Standardize usage of virtual/override/final in media/ (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 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/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "media/base/audio_decoder_config.h" 10 #include "media/base/audio_decoder_config.h"
11 #include "media/base/channel_layout.h" 11 #include "media/base/channel_layout.h"
12 #include "media/base/demuxer_stream_provider.h" 12 #include "media/base/demuxer_stream_provider.h"
13 #include "media/base/sample_format.h" 13 #include "media/base/sample_format.h"
14 #include "media/base/video_decoder_config.h" 14 #include "media/base/video_decoder_config.h"
15 #include "media/mojo/services/mojo_renderer_impl.h" 15 #include "media/mojo/services/mojo_renderer_impl.h"
16 #include "mojo/public/c/system/main.h" 16 #include "mojo/public/c/system/main.h"
17 #include "mojo/public/cpp/application/application_delegate.h" 17 #include "mojo/public/cpp/application/application_delegate.h"
18 #include "mojo/public/cpp/application/application_impl.h" 18 #include "mojo/public/cpp/application/application_impl.h"
19 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
20 20
21 namespace { 21 namespace {
22 22
23 // This class is here to give the gtest class access to the 23 // This class is here to give the gtest class access to the
24 // mojo::ApplicationImpl so that the tests can connect to other applications. 24 // mojo::ApplicationImpl so that the tests can connect to other applications.
25 class MojoRendererTestHelper : public mojo::ApplicationDelegate { 25 class MojoRendererTestHelper : public mojo::ApplicationDelegate {
26 public: 26 public:
27 MojoRendererTestHelper() : application_impl_(NULL) {} 27 MojoRendererTestHelper() : application_impl_(NULL) {}
28 virtual ~MojoRendererTestHelper() {} 28 ~MojoRendererTestHelper() override {}
29 29
30 // ApplicationDelegate implementation. 30 // ApplicationDelegate implementation.
31 virtual void Initialize(mojo::ApplicationImpl* app) override { 31 void Initialize(mojo::ApplicationImpl* app) override {
32 application_impl_ = app; 32 application_impl_ = app;
33 } 33 }
34 34
35 mojo::ApplicationImpl* application_impl() { return application_impl_; } 35 mojo::ApplicationImpl* application_impl() { return application_impl_; }
36 36
37 private: 37 private:
38 mojo::ApplicationImpl* application_impl_; 38 mojo::ApplicationImpl* application_impl_;
39 39
40 DISALLOW_COPY_AND_ASSIGN(MojoRendererTestHelper); 40 DISALLOW_COPY_AND_ASSIGN(MojoRendererTestHelper);
41 }; 41 };
42 42
43 // TODO(tim): Reconcile this with mojo apptest framework when ready. 43 // TODO(tim): Reconcile this with mojo apptest framework when ready.
44 MojoRendererTestHelper* g_test_delegate = NULL; 44 MojoRendererTestHelper* g_test_delegate = NULL;
45 45
46 // TODO(tim): Make media::FakeDemuxerStream support audio and use that for the 46 // TODO(tim): Make media::FakeDemuxerStream support audio and use that for the
47 // DemuxerStream implementation instead. 47 // DemuxerStream implementation instead.
48 class FakeDemuxerStream : public media::DemuxerStreamProvider, 48 class FakeDemuxerStream : public media::DemuxerStreamProvider,
49 public media::DemuxerStream { 49 public media::DemuxerStream {
50 public: 50 public:
51 FakeDemuxerStream() {} 51 FakeDemuxerStream() {}
52 virtual ~FakeDemuxerStream() {} 52 ~FakeDemuxerStream() override {}
53 53
54 // media::Demuxer implementation. 54 // media::Demuxer implementation.
55 virtual media::DemuxerStream* GetStream( 55 media::DemuxerStream* GetStream(media::DemuxerStream::Type type) override {
56 media::DemuxerStream::Type type) override {
57 DCHECK_EQ(media::DemuxerStream::AUDIO, type); 56 DCHECK_EQ(media::DemuxerStream::AUDIO, type);
58 return this; 57 return this;
59 } 58 }
60 virtual media::DemuxerStreamProvider::Liveness GetLiveness() const override { 59 media::DemuxerStreamProvider::Liveness GetLiveness() const override {
61 return media::DemuxerStreamProvider::LIVENESS_UNKNOWN; 60 return media::DemuxerStreamProvider::LIVENESS_UNKNOWN;
62 } 61 }
63 62
64 // media::DemuxerStream implementation. 63 // media::DemuxerStream implementation.
65 virtual void Read(const ReadCB& read_cb) override {} 64 void Read(const ReadCB& read_cb) override {}
66 65
67 virtual media::AudioDecoderConfig audio_decoder_config() override { 66 media::AudioDecoderConfig audio_decoder_config() override {
68 media::AudioDecoderConfig config; 67 media::AudioDecoderConfig config;
69 config.Initialize(media::kCodecAAC, 68 config.Initialize(media::kCodecAAC,
70 media::kSampleFormatU8, 69 media::kSampleFormatU8,
71 media::CHANNEL_LAYOUT_SURROUND, 70 media::CHANNEL_LAYOUT_SURROUND,
72 48000, 71 48000,
73 NULL, 72 NULL,
74 0, 73 0,
75 false, 74 false,
76 false, 75 false,
77 base::TimeDelta(), 76 base::TimeDelta(),
78 0); 77 0);
79 return config; 78 return config;
80 } 79 }
81 80
82 virtual media::VideoDecoderConfig video_decoder_config() override { 81 media::VideoDecoderConfig video_decoder_config() override {
83 NOTREACHED(); 82 NOTREACHED();
84 return media::VideoDecoderConfig(); 83 return media::VideoDecoderConfig();
85 } 84 }
86 85
87 virtual media::DemuxerStream::Type type() override { 86 media::DemuxerStream::Type type() override {
88 return media::DemuxerStream::AUDIO; 87 return media::DemuxerStream::AUDIO;
89 } 88 }
90 89
91 virtual void EnableBitstreamConverter() override {} 90 void EnableBitstreamConverter() override {}
92 91
93 virtual bool SupportsConfigChanges() override { return true; } 92 bool SupportsConfigChanges() override { return true; }
94 93
95 virtual media::VideoRotation video_rotation() override { 94 media::VideoRotation video_rotation() override {
96 NOTREACHED(); 95 NOTREACHED();
97 return media::VIDEO_ROTATION_0; 96 return media::VIDEO_ROTATION_0;
98 } 97 }
99 98
100 private: 99 private:
101 DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStream); 100 DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStream);
102 }; 101 };
103 102
104 } // namespace 103 } // namespace
105 104
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 int argc = 0; 175 int argc = 0;
177 char** argv = NULL; 176 char** argv = NULL;
178 testing::InitGoogleTest(&argc, argv); 177 testing::InitGoogleTest(&argc, argv);
179 mojo_ignore_result(RUN_ALL_TESTS()); 178 mojo_ignore_result(RUN_ALL_TESTS());
180 } 179 }
181 180
182 g_test_delegate = NULL; 181 g_test_delegate = NULL;
183 delegate.reset(); 182 delegate.reset();
184 return MOJO_RESULT_OK; 183 return MOJO_RESULT_OK;
185 } 184 }
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_renderer_service.cc ('k') | media/video/capture/fake_video_capture_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698