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

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

Issue 1882423004: Move shell service to toplevel shell namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 | « media/mojo/services/main.cc ('k') | media/mojo/services/mojo_cdm_factory.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 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // interfaces::RendererClient implementation. 45 // interfaces::RendererClient implementation.
46 MOCK_METHOD2(OnTimeUpdate, void(int64_t time_usec, int64_t max_time_usec)); 46 MOCK_METHOD2(OnTimeUpdate, void(int64_t time_usec, int64_t max_time_usec));
47 MOCK_METHOD1(OnBufferingStateChange, void(interfaces::BufferingState state)); 47 MOCK_METHOD1(OnBufferingStateChange, void(interfaces::BufferingState state));
48 MOCK_METHOD0(OnEnded, void()); 48 MOCK_METHOD0(OnEnded, void());
49 MOCK_METHOD0(OnError, void()); 49 MOCK_METHOD0(OnError, void());
50 50
51 private: 51 private:
52 DISALLOW_COPY_AND_ASSIGN(MockRendererClient); 52 DISALLOW_COPY_AND_ASSIGN(MockRendererClient);
53 }; 53 };
54 54
55 class MediaAppTest : public mojo::test::ApplicationTestBase { 55 class MediaAppTest : public shell::test::ApplicationTestBase {
56 public: 56 public:
57 MediaAppTest() 57 MediaAppTest()
58 : renderer_client_binding_(&renderer_client_), 58 : renderer_client_binding_(&renderer_client_),
59 video_demuxer_stream_(DemuxerStream::VIDEO) {} 59 video_demuxer_stream_(DemuxerStream::VIDEO) {}
60 ~MediaAppTest() override {} 60 ~MediaAppTest() override {}
61 61
62 void SetUp() override { 62 void SetUp() override {
63 ApplicationTestBase::SetUp(); 63 ApplicationTestBase::SetUp();
64 64
65 connection_ = connector()->Connect("mojo:media"); 65 connection_ = connector()->Connect("mojo:media");
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 interfaces::ServiceFactoryPtr service_factory_; 121 interfaces::ServiceFactoryPtr service_factory_;
122 interfaces::ContentDecryptionModulePtr cdm_; 122 interfaces::ContentDecryptionModulePtr cdm_;
123 interfaces::RendererPtr renderer_; 123 interfaces::RendererPtr renderer_;
124 124
125 StrictMock<MockRendererClient> renderer_client_; 125 StrictMock<MockRendererClient> renderer_client_;
126 mojo::Binding<interfaces::RendererClient> renderer_client_binding_; 126 mojo::Binding<interfaces::RendererClient> renderer_client_binding_;
127 127
128 StrictMock<MockDemuxerStream> video_demuxer_stream_; 128 StrictMock<MockDemuxerStream> video_demuxer_stream_;
129 129
130 private: 130 private:
131 std::unique_ptr<mojo::Connection> connection_; 131 std::unique_ptr<shell::Connection> connection_;
132 132
133 DISALLOW_COPY_AND_ASSIGN(MediaAppTest); 133 DISALLOW_COPY_AND_ASSIGN(MediaAppTest);
134 }; 134 };
135 135
136 } // namespace 136 } // namespace
137 137
138 // Note: base::RunLoop::RunUntilIdle() does not work well in these tests because 138 // Note: base::RunLoop::RunUntilIdle() does not work well in these tests because
139 // even when the loop is idle, we may still have pending events in the pipe. 139 // even when the loop is idle, we may still have pending events in the pipe.
140 140
141 #if defined(ENABLE_MOJO_CDM) 141 #if defined(ENABLE_MOJO_CDM)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // close the connection. 178 // close the connection.
179 EXPECT_CALL(*this, ConnectionClosed()) 179 EXPECT_CALL(*this, ConnectionClosed())
180 .Times(Exactly(1)) 180 .Times(Exactly(1))
181 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit)); 181 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit));
182 service_factory_.reset(); 182 service_factory_.reset();
183 183
184 run_loop_->Run(); 184 run_loop_->Run();
185 } 185 }
186 186
187 } // namespace media 187 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/main.cc ('k') | media/mojo/services/mojo_cdm_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698