OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // This test generate synthetic data. For audio it's a sinusoid waveform with | 5 // This test generate synthetic data. For audio it's a sinusoid waveform with |
6 // frequency kSoundFrequency and different amplitudes. For video it's a pattern | 6 // frequency kSoundFrequency and different amplitudes. For video it's a pattern |
7 // that is shifting by one pixel per frame, each pixels neighbors right and down | 7 // that is shifting by one pixel per frame, each pixels neighbors right and down |
8 // is this pixels value +1, since the pixel value is 8 bit it will wrap | 8 // is this pixels value +1, since the pixel value is 8 bit it will wrap |
9 // frequently within the image. Visually this will create diagonally color bands | 9 // frequently within the image. Visually this will create diagonally color bands |
10 // that moves across the screen | 10 // that moves across the screen |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 | 887 |
888 namespace { | 888 namespace { |
889 | 889 |
890 class TransportClient : public CastTransport::Client { | 890 class TransportClient : public CastTransport::Client { |
891 public: | 891 public: |
892 TransportClient(LogEventDispatcher* log_event_dispatcher, | 892 TransportClient(LogEventDispatcher* log_event_dispatcher, |
893 End2EndTest* e2e_test) | 893 End2EndTest* e2e_test) |
894 : log_event_dispatcher_(log_event_dispatcher), e2e_test_(e2e_test) {} | 894 : log_event_dispatcher_(log_event_dispatcher), e2e_test_(e2e_test) {} |
895 | 895 |
896 void OnStatusChanged(media::cast::CastTransportStatus status) final { | 896 void OnStatusChanged(media::cast::CastTransportStatus status) final { |
897 bool result = (status == TRANSPORT_AUDIO_INITIALIZED || | 897 EXPECT_EQ(TRANSPORT_STREAM_INITIALIZED, status); |
898 status == TRANSPORT_VIDEO_INITIALIZED); | |
899 EXPECT_TRUE(result); | |
900 }; | 898 }; |
901 void OnLoggingEventsReceived( | 899 void OnLoggingEventsReceived( |
902 std::unique_ptr<std::vector<FrameEvent>> frame_events, | 900 std::unique_ptr<std::vector<FrameEvent>> frame_events, |
903 std::unique_ptr<std::vector<PacketEvent>> packet_events) final { | 901 std::unique_ptr<std::vector<PacketEvent>> packet_events) final { |
904 log_event_dispatcher_->DispatchBatchOfEvents(std::move(frame_events), | 902 log_event_dispatcher_->DispatchBatchOfEvents(std::move(frame_events), |
905 std::move(packet_events)); | 903 std::move(packet_events)); |
906 }; | 904 }; |
907 void ProcessRtpPacket(std::unique_ptr<Packet> packet) final { | 905 void ProcessRtpPacket(std::unique_ptr<Packet> packet) final { |
908 if (e2e_test_) | 906 if (e2e_test_) |
909 e2e_test_->ReceivePacket(std::move(packet)); | 907 e2e_test_->ReceivePacket(std::move(packet)); |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 EXPECT_EQ(0u, jump); | 1269 EXPECT_EQ(0u, jump); |
1272 jump = i; | 1270 jump = i; |
1273 } | 1271 } |
1274 } | 1272 } |
1275 EXPECT_GT(jump, 49u); | 1273 EXPECT_GT(jump, 49u); |
1276 EXPECT_LT(jump, 120u); | 1274 EXPECT_LT(jump, 120u); |
1277 } | 1275 } |
1278 | 1276 |
1279 } // namespace cast | 1277 } // namespace cast |
1280 } // namespace media | 1278 } // namespace media |
OLD | NEW |