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

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

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 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 | « mash/wm/window_manager_impl.cc ('k') | media/mojo/services/mojo_media_application.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <stdint.h> 5 #include <stdint.h>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/run_loop.h" 12 #include "base/run_loop.h"
13 #include "media/base/cdm_config.h" 13 #include "media/base/cdm_config.h"
14 #include "media/base/mock_filters.h" 14 #include "media/base/mock_filters.h"
15 #include "media/base/test_helpers.h" 15 #include "media/base/test_helpers.h"
16 #include "media/cdm/key_system_names.h" 16 #include "media/cdm/key_system_names.h"
17 #include "media/mojo/interfaces/content_decryption_module.mojom.h" 17 #include "media/mojo/interfaces/content_decryption_module.mojom.h"
18 #include "media/mojo/interfaces/decryptor.mojom.h" 18 #include "media/mojo/interfaces/decryptor.mojom.h"
19 #include "media/mojo/interfaces/renderer.mojom.h" 19 #include "media/mojo/interfaces/renderer.mojom.h"
20 #include "media/mojo/interfaces/service_factory.mojom.h" 20 #include "media/mojo/interfaces/service_factory.mojom.h"
21 #include "media/mojo/services/media_type_converters.h" 21 #include "media/mojo/services/media_type_converters.h"
22 #include "media/mojo/services/mojo_demuxer_stream_impl.h" 22 #include "media/mojo/services/mojo_demuxer_stream_impl.h"
23 #include "mojo/shell/public/cpp/application_connection.h" 23 #include "mojo/shell/public/cpp/application_connection.h"
24 #include "mojo/shell/public/cpp/application_impl.h"
25 #include "mojo/shell/public/cpp/application_test_base.h" 24 #include "mojo/shell/public/cpp/application_test_base.h"
26 #include "testing/gmock/include/gmock/gmock.h" 25 #include "testing/gmock/include/gmock/gmock.h"
27 26
28 using testing::Exactly; 27 using testing::Exactly;
29 using testing::Invoke; 28 using testing::Invoke;
30 using testing::InvokeWithoutArgs; 29 using testing::InvokeWithoutArgs;
31 using testing::StrictMock; 30 using testing::StrictMock;
32 31
33 namespace media { 32 namespace media {
34 namespace { 33 namespace {
(...skipping 19 matching lines...) Expand all
54 class MediaAppTest : public mojo::test::ApplicationTestBase { 53 class MediaAppTest : public mojo::test::ApplicationTestBase {
55 public: 54 public:
56 MediaAppTest() 55 MediaAppTest()
57 : renderer_client_binding_(&renderer_client_), 56 : renderer_client_binding_(&renderer_client_),
58 video_demuxer_stream_(DemuxerStream::VIDEO) {} 57 video_demuxer_stream_(DemuxerStream::VIDEO) {}
59 ~MediaAppTest() override {} 58 ~MediaAppTest() override {}
60 59
61 void SetUp() override { 60 void SetUp() override {
62 ApplicationTestBase::SetUp(); 61 ApplicationTestBase::SetUp();
63 62
64 connection_ = application_impl()->ConnectToApplication("mojo:media"); 63 connection_ = shell()->ConnectToApplication("mojo:media");
65 connection_->SetRemoteServiceProviderConnectionErrorHandler( 64 connection_->SetRemoteServiceProviderConnectionErrorHandler(
66 base::Bind(&MediaAppTest::ConnectionClosed, base::Unretained(this))); 65 base::Bind(&MediaAppTest::ConnectionClosed, base::Unretained(this)));
67 66
68 connection_->ConnectToService(&service_factory_); 67 connection_->ConnectToService(&service_factory_);
69 service_factory_->CreateCdm(mojo::GetProxy(&cdm_)); 68 service_factory_->CreateCdm(mojo::GetProxy(&cdm_));
70 service_factory_->CreateRenderer(mojo::GetProxy(&renderer_)); 69 service_factory_->CreateRenderer(mojo::GetProxy(&renderer_));
71 70
72 run_loop_.reset(new base::RunLoop()); 71 run_loop_.reset(new base::RunLoop());
73 } 72 }
74 73
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // close the connection. 163 // close the connection.
165 EXPECT_CALL(*this, ConnectionClosed()) 164 EXPECT_CALL(*this, ConnectionClosed())
166 .Times(Exactly(1)) 165 .Times(Exactly(1))
167 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit)); 166 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit));
168 service_factory_.reset(); 167 service_factory_.reset();
169 168
170 run_loop_->Run(); 169 run_loop_->Run();
171 } 170 }
172 171
173 } // namespace media 172 } // namespace media
OLDNEW
« no previous file with comments | « mash/wm/window_manager_impl.cc ('k') | media/mojo/services/mojo_media_application.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698