OLD | NEW |
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 25 matching lines...) Expand all Loading... |
36 #include "media/renderers/renderer_impl.h" | 36 #include "media/renderers/renderer_impl.h" |
37 #include "media/test/pipeline_integration_test_base.h" | 37 #include "media/test/pipeline_integration_test_base.h" |
38 #include "testing/gmock/include/gmock/gmock.h" | 38 #include "testing/gmock/include/gmock/gmock.h" |
39 #include "url/gurl.h" | 39 #include "url/gurl.h" |
40 | 40 |
41 #if defined(MOJO_RENDERER) | 41 #if defined(MOJO_RENDERER) |
42 #include "media/mojo/clients/mojo_renderer.h" | 42 #include "media/mojo/clients/mojo_renderer.h" |
43 #include "media/mojo/interfaces/renderer.mojom.h" | 43 #include "media/mojo/interfaces/renderer.mojom.h" |
44 #include "media/mojo/interfaces/service_factory.mojom.h" | 44 #include "media/mojo/interfaces/service_factory.mojom.h" |
45 #include "services/shell/public/cpp/connect.h" | 45 #include "services/shell/public/cpp/connect.h" |
46 #include "services/shell/public/cpp/shell_test.h" | 46 #include "services/shell/public/cpp/service_test.h" |
47 | 47 |
48 // TODO(dalecurtis): The mojo renderer is in another process, so we have no way | 48 // TODO(dalecurtis): The mojo renderer is in another process, so we have no way |
49 // currently to get hashes for video and audio samples. This also means that | 49 // currently to get hashes for video and audio samples. This also means that |
50 // real audio plays out for each test. | 50 // real audio plays out for each test. |
51 #define EXPECT_HASH_EQ(a, b) | 51 #define EXPECT_HASH_EQ(a, b) |
52 #define EXPECT_VIDEO_FORMAT_EQ(a, b) | 52 #define EXPECT_VIDEO_FORMAT_EQ(a, b) |
53 #define EXPECT_COLOR_SPACE_EQ(a, b) | 53 #define EXPECT_COLOR_SPACE_EQ(a, b) |
54 | 54 |
55 // TODO(xhwang): EME support is not complete for the mojo renderer, so all | 55 // TODO(xhwang): EME support is not complete for the mojo renderer, so all |
56 // encrypted tests are currently disabled. | 56 // encrypted tests are currently disabled. |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb_; | 693 Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb_; |
694 base::TimeDelta last_timestamp_offset_; | 694 base::TimeDelta last_timestamp_offset_; |
695 }; | 695 }; |
696 | 696 |
697 // TODO(xhwang): These tests have been disabled for some time as apptests and no | 697 // TODO(xhwang): These tests have been disabled for some time as apptests and no |
698 // longer pass. They need to be reconstituted as shell tests. | 698 // longer pass. They need to be reconstituted as shell tests. |
699 // Currently there are compile issues which must be resolved, | 699 // Currently there are compile issues which must be resolved, |
700 // preferably by eliminating multiple inheritance here which is | 700 // preferably by eliminating multiple inheritance here which is |
701 // banned by Google C++ style. | 701 // banned by Google C++ style. |
702 #if defined(MOJO_RENDERER) && defined(ENABLE_MOJO_PIPELINE_INTEGRATION_TEST) | 702 #if defined(MOJO_RENDERER) && defined(ENABLE_MOJO_PIPELINE_INTEGRATION_TEST) |
703 class PipelineIntegrationTestHost : public shell::test::ShellTest, | 703 class PipelineIntegrationTestHost : public shell::test::ServiceTest, |
704 public PipelineIntegrationTestBase { | 704 public PipelineIntegrationTestBase { |
705 public: | 705 public: |
706 PipelineIntegrationTestHost() | 706 PipelineIntegrationTestHost() |
707 : shell::test::ShellTest("exe:media_pipeline_integration_shelltests") {} | 707 : shell::test::ServiceTest("exe:media_pipeline_integration_shelltests") {} |
708 | 708 |
709 void SetUp() override { | 709 void SetUp() override { |
710 ShellTest::SetUp(); | 710 ServiceTest::SetUp(); |
711 InitializeMediaLibrary(); | 711 InitializeMediaLibrary(); |
712 } | 712 } |
713 | 713 |
714 protected: | 714 protected: |
715 std::unique_ptr<Renderer> CreateRenderer() override { | 715 std::unique_ptr<Renderer> CreateRenderer() override { |
716 connector()->ConnectToInterface("mojo:media", &media_service_factory_); | 716 connector()->ConnectToInterface("mojo:media", &media_service_factory_); |
717 | 717 |
718 mojom::RendererPtr mojo_renderer; | 718 mojom::RendererPtr mojo_renderer; |
719 media_service_factory_->CreateRenderer(mojo::GetProxy(&mojo_renderer)); | 719 media_service_factory_->CreateRenderer(mojo::GetProxy(&mojo_renderer)); |
720 | 720 |
(...skipping 1678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2399 | 2399 |
2400 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { | 2400 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { |
2401 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); | 2401 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); |
2402 Play(); | 2402 Play(); |
2403 ASSERT_TRUE(WaitUntilOnEnded()); | 2403 ASSERT_TRUE(WaitUntilOnEnded()); |
2404 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), | 2404 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), |
2405 demuxer_->GetStartTime()); | 2405 demuxer_->GetStartTime()); |
2406 } | 2406 } |
2407 | 2407 |
2408 } // namespace media | 2408 } // namespace media |
OLD | NEW |