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

Side by Side Diff: media/test/pipeline_integration_test.cc

Issue 2444623002: media: Rename ServiceFactory to InterfaceFactory (Closed)
Patch Set: media: Rename ServiceFactory to InterfaceFactory Created 4 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
« no previous file with comments | « media/mojo/services/test_manifest.json ('k') | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 20 matching lines...) Expand all
31 #include "media/cdm/aes_decryptor.h" 31 #include "media/cdm/aes_decryptor.h"
32 #include "media/cdm/json_web_key.h" 32 #include "media/cdm/json_web_key.h"
33 #include "media/filters/chunk_demuxer.h" 33 #include "media/filters/chunk_demuxer.h"
34 #include "media/renderers/renderer_impl.h" 34 #include "media/renderers/renderer_impl.h"
35 #include "media/test/pipeline_integration_test_base.h" 35 #include "media/test/pipeline_integration_test_base.h"
36 #include "testing/gmock/include/gmock/gmock.h" 36 #include "testing/gmock/include/gmock/gmock.h"
37 #include "url/gurl.h" 37 #include "url/gurl.h"
38 38
39 #if defined(MOJO_RENDERER) 39 #if defined(MOJO_RENDERER)
40 #include "media/mojo/clients/mojo_renderer.h" 40 #include "media/mojo/clients/mojo_renderer.h"
41 #include "media/mojo/interfaces/interface_factory.mojom.h"
41 #include "media/mojo/interfaces/renderer.mojom.h" 42 #include "media/mojo/interfaces/renderer.mojom.h"
42 #include "media/mojo/interfaces/service_factory.mojom.h"
43 #include "services/service_manager/public/cpp/connect.h" 43 #include "services/service_manager/public/cpp/connect.h"
44 #include "services/service_manager/public/cpp/service_test.h" 44 #include "services/service_manager/public/cpp/service_test.h"
45 45
46 // TODO(dalecurtis): The mojo renderer is in another process, so we have no way 46 // TODO(dalecurtis): The mojo renderer is in another process, so we have no way
47 // currently to get hashes for video and audio samples. This also means that 47 // currently to get hashes for video and audio samples. This also means that
48 // real audio plays out for each test. 48 // real audio plays out for each test.
49 #define EXPECT_HASH_EQ(a, b) 49 #define EXPECT_HASH_EQ(a, b)
50 #define EXPECT_VIDEO_FORMAT_EQ(a, b) 50 #define EXPECT_VIDEO_FORMAT_EQ(a, b)
51 #define EXPECT_COLOR_SPACE_EQ(a, b) 51 #define EXPECT_COLOR_SPACE_EQ(a, b)
52 52
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 : service_manager::test::ServiceTest( 682 : service_manager::test::ServiceTest(
683 "exe:media_pipeline_integration_shelltests") {} 683 "exe:media_pipeline_integration_shelltests") {}
684 684
685 void SetUp() override { 685 void SetUp() override {
686 ServiceTest::SetUp(); 686 ServiceTest::SetUp();
687 InitializeMediaLibrary(); 687 InitializeMediaLibrary();
688 } 688 }
689 689
690 protected: 690 protected:
691 std::unique_ptr<Renderer> CreateRenderer() override { 691 std::unique_ptr<Renderer> CreateRenderer() override {
692 connector()->ConnectToInterface("service:media", &media_service_factory_); 692 connector()->ConnectToInterface("service:media", &media_interface_factory_);
693 693
694 mojom::RendererPtr mojo_renderer; 694 mojom::RendererPtr mojo_renderer;
695 media_service_factory_->CreateRenderer(std::string(), 695 media_interface_factory_->CreateRenderer(std::string(),
696 mojo::GetProxy(&mojo_renderer)); 696 mojo::GetProxy(&mojo_renderer));
697 697
698 return base::MakeUnique<MojoRenderer>(message_loop_.task_runner(), 698 return base::MakeUnique<MojoRenderer>(message_loop_.task_runner(),
699 std::move(mojo_renderer)); 699 std::move(mojo_renderer));
700 } 700 }
701 701
702 private: 702 private:
703 mojom::ServiceFactoryPtr media_service_factory_; 703 mojom::InterfaceFactoryPtr media_interface_factory_;
704 }; 704 };
705 #else 705 #else
706 class PipelineIntegrationTestHost : public testing::Test, 706 class PipelineIntegrationTestHost : public testing::Test,
707 public PipelineIntegrationTestBase {}; 707 public PipelineIntegrationTestBase {};
708 #endif // defined(MOJO_RENDERER) 708 #endif // defined(MOJO_RENDERER)
709 709
710 class PipelineIntegrationTest : public PipelineIntegrationTestHost { 710 class PipelineIntegrationTest : public PipelineIntegrationTestHost {
711 public: 711 public:
712 PipelineStatus StartPipelineWithMediaSource(MockMediaSource* source) { 712 PipelineStatus StartPipelineWithMediaSource(MockMediaSource* source) {
713 return StartPipelineWithMediaSource(source, kNormal, nullptr); 713 return StartPipelineWithMediaSource(source, kNormal, nullptr);
(...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after
2478 2478
2479 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { 2479 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) {
2480 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); 2480 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm"));
2481 Play(); 2481 Play();
2482 ASSERT_TRUE(WaitUntilOnEnded()); 2482 ASSERT_TRUE(WaitUntilOnEnded());
2483 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), 2483 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000),
2484 demuxer_->GetStartTime()); 2484 demuxer_->GetStartTime());
2485 } 2485 }
2486 2486
2487 } // namespace media 2487 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/test_manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698