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 "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" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 void ErrorCallback(PipelineStatus* output, PipelineStatus status) { | 135 void ErrorCallback(PipelineStatus* output, PipelineStatus status) { |
136 *output = status; | 136 *output = status; |
137 } | 137 } |
138 | 138 |
139 // Tests that a MojoRendererImpl can successfully establish communication | 139 // Tests that a MojoRendererImpl can successfully establish communication |
140 // with a MojoRendererService and set up a MojoDemuxerStream | 140 // with a MojoRendererService and set up a MojoDemuxerStream |
141 // connection. The test also initializes a media::AudioRendererImpl which | 141 // connection. The test also initializes a media::AudioRendererImpl which |
142 // will error-out expectedly due to lack of support for decoder selection. | 142 // will error-out expectedly due to lack of support for decoder selection. |
143 TEST_F(MojoRendererTest, BasicInitialize) { | 143 TEST_F(MojoRendererTest, BasicInitialize) { |
144 MojoRendererImpl rimpl(task_runner(), stream_provider(), service_provider()); | 144 MojoRendererImpl rimpl(task_runner(), service_provider()); |
145 PipelineStatus expected_error(PIPELINE_OK); | 145 PipelineStatus expected_error(PIPELINE_OK); |
146 rimpl.Initialize(base::MessageLoop::current()->QuitClosure(), | 146 rimpl.Initialize(stream_provider(), |
| 147 base::MessageLoop::current()->QuitClosure(), |
147 media::StatisticsCB(), | 148 media::StatisticsCB(), |
148 base::Closure(), | 149 base::Closure(), |
149 base::Bind(&ErrorCallback, &expected_error), | 150 base::Bind(&ErrorCallback, &expected_error), |
150 media::BufferingStateCB()); | 151 media::BufferingStateCB()); |
151 base::MessageLoop::current()->Run(); | 152 base::MessageLoop::current()->Run(); |
152 | 153 |
153 // We expect an error during initialization because MojoRendererService | 154 // We expect an error during initialization because MojoRendererService |
154 // doesn't initialize any decoders, which causes an error. | 155 // doesn't initialize any decoders, which causes an error. |
155 EXPECT_EQ(PIPELINE_ERROR_COULD_NOT_RENDER, expected_error); | 156 EXPECT_EQ(PIPELINE_ERROR_COULD_NOT_RENDER, expected_error); |
156 } | 157 } |
(...skipping 18 matching lines...) Expand all Loading... |
175 int argc = 0; | 176 int argc = 0; |
176 char** argv = NULL; | 177 char** argv = NULL; |
177 testing::InitGoogleTest(&argc, argv); | 178 testing::InitGoogleTest(&argc, argv); |
178 mojo_ignore_result(RUN_ALL_TESTS()); | 179 mojo_ignore_result(RUN_ALL_TESTS()); |
179 } | 180 } |
180 | 181 |
181 g_test_delegate = NULL; | 182 g_test_delegate = NULL; |
182 delegate.reset(); | 183 delegate.reset(); |
183 return MOJO_RESULT_OK; | 184 return MOJO_RESULT_OK; |
184 } | 185 } |
OLD | NEW |