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

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

Issue 793973004: Fix media::MojoRendererTest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « no previous file | 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 "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/run_loop.h" 7 #include "base/run_loop.h"
8 #include "media/base/audio_decoder_config.h" 8 #include "media/base/audio_decoder_config.h"
9 #include "media/base/channel_layout.h" 9 #include "media/base/channel_layout.h"
10 #include "media/base/demuxer_stream_provider.h" 10 #include "media/base/demuxer_stream_provider.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 private: 92 private:
93 DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStream); 93 DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStream);
94 }; 94 };
95 95
96 } // namespace 96 } // namespace
97 97
98 namespace media { 98 namespace media {
99 99
100 class MojoRendererTest : public mojo::test::ApplicationTestBase { 100 class MojoRendererTest : public mojo::test::ApplicationTestBase {
101 public: 101 public:
102 MojoRendererTest() 102 MojoRendererTest() : service_provider_(NULL) {}
103 : service_provider_(NULL) {}
104 ~MojoRendererTest() override {} 103 ~MojoRendererTest() override {}
105 104
106 protected: 105 protected:
107 // ApplicationTestBase implementation. 106 // ApplicationTestBase implementation.
108 mojo::ApplicationDelegate* GetApplicationDelegate() override { 107 mojo::ApplicationDelegate* GetApplicationDelegate() override {
109 return &mojo_renderer_test_helper_; 108 return &mojo_renderer_test_helper_;
110 } 109 }
111 110
112 void SetUp() override { 111 void SetUp() override {
113 ApplicationTestBase::SetUp(); 112 ApplicationTestBase::SetUp();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // will error-out expectedly due to lack of support for decoder selection. 149 // will error-out expectedly due to lack of support for decoder selection.
151 TEST_F(MojoRendererTest, BasicInitialize) { 150 TEST_F(MojoRendererTest, BasicInitialize) {
152 MojoRendererImpl mojo_renderer_impl(task_runner(), CreateMediaRenderer()); 151 MojoRendererImpl mojo_renderer_impl(task_runner(), CreateMediaRenderer());
153 PipelineStatus expected_error(PIPELINE_OK); 152 PipelineStatus expected_error(PIPELINE_OK);
154 mojo_renderer_impl.Initialize( 153 mojo_renderer_impl.Initialize(
155 stream_provider(), base::MessageLoop::current()->QuitClosure(), 154 stream_provider(), base::MessageLoop::current()->QuitClosure(),
156 media::StatisticsCB(), media::BufferingStateCB(), 155 media::StatisticsCB(), media::BufferingStateCB(),
157 media::Renderer::PaintCB(), base::Closure(), 156 media::Renderer::PaintCB(), base::Closure(),
158 base::Bind(&ErrorCallback, &expected_error)); 157 base::Bind(&ErrorCallback, &expected_error));
159 base::MessageLoop::current()->Run(); 158 base::MessageLoop::current()->Run();
160 159 EXPECT_EQ(PIPELINE_OK, expected_error);
161 // We expect an error during initialization because MojoRendererService
162 // doesn't initialize any decoders, which causes an error.
163 EXPECT_EQ(PIPELINE_ERROR_COULD_NOT_RENDER, expected_error);
164 } 160 }
165 161
166 } // namespace media 162 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698