| 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 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 Decryptor* decryptor_; | 276 Decryptor* decryptor_; |
| 277 }; | 277 }; |
| 278 | 278 |
| 279 scoped_refptr<AesDecryptor> decryptor_; | 279 scoped_refptr<AesDecryptor> decryptor_; |
| 280 TestCdmContext cdm_context_; | 280 TestCdmContext cdm_context_; |
| 281 scoped_ptr<AppBase> app_; | 281 scoped_ptr<AppBase> app_; |
| 282 }; | 282 }; |
| 283 | 283 |
| 284 enum PromiseResult { RESOLVED, REJECTED }; | 284 enum PromiseResult { RESOLVED, REJECTED }; |
| 285 | 285 |
| 286 // Provides |kSecretKey| in response to needkey. | 286 // Provides |kSecretKey| in response to the encrypted event. |
| 287 class KeyProvidingApp : public FakeEncryptedMedia::AppBase { | 287 class KeyProvidingApp : public FakeEncryptedMedia::AppBase { |
| 288 public: | 288 public: |
| 289 KeyProvidingApp() {} | 289 KeyProvidingApp() {} |
| 290 | 290 |
| 291 void OnResolveWithSession(PromiseResult expected, | 291 void OnResolveWithSession(PromiseResult expected, |
| 292 const std::string& session_id) { | 292 const std::string& session_id) { |
| 293 EXPECT_EQ(expected, RESOLVED); | 293 EXPECT_EQ(expected, RESOLVED); |
| 294 EXPECT_GT(session_id.length(), 0ul); | 294 EXPECT_GT(session_id.length(), 0ul); |
| 295 current_session_id_ = session_id; | 295 current_session_id_ = session_id; |
| 296 } | 296 } |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 std::rotate(key->begin(), key->begin() + pos, key->end()); | 436 std::rotate(key->begin(), key->begin() + pos, key->end()); |
| 437 return true; | 437 return true; |
| 438 } | 438 } |
| 439 } | 439 } |
| 440 return false; | 440 return false; |
| 441 } | 441 } |
| 442 | 442 |
| 443 uint32_t num_distinct_need_key_calls_; | 443 uint32_t num_distinct_need_key_calls_; |
| 444 }; | 444 }; |
| 445 | 445 |
| 446 // Ignores needkey and does not perform a license request | 446 // Ignores the encrypted event and does not perform a license request. |
| 447 class NoResponseApp : public FakeEncryptedMedia::AppBase { | 447 class NoResponseApp : public FakeEncryptedMedia::AppBase { |
| 448 public: | 448 public: |
| 449 void OnSessionMessage(const std::string& session_id, | 449 void OnSessionMessage(const std::string& session_id, |
| 450 MediaKeys::MessageType message_type, | 450 MediaKeys::MessageType message_type, |
| 451 const std::vector<uint8_t>& message, | 451 const std::vector<uint8_t>& message, |
| 452 const GURL& legacy_destination_url, | 452 const GURL& legacy_destination_url, |
| 453 AesDecryptor* decryptor) override { | 453 AesDecryptor* decryptor) override { |
| 454 EXPECT_FALSE(session_id.empty()); | 454 EXPECT_FALSE(session_id.empty()); |
| 455 EXPECT_FALSE(message.empty()); | 455 EXPECT_FALSE(message.empty()); |
| 456 FAIL() << "Unexpected Message"; | 456 FAIL() << "Unexpected Message"; |
| (...skipping 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2020 | 2020 |
| 2021 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { | 2021 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { |
| 2022 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); | 2022 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); |
| 2023 Play(); | 2023 Play(); |
| 2024 ASSERT_TRUE(WaitUntilOnEnded()); | 2024 ASSERT_TRUE(WaitUntilOnEnded()); |
| 2025 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), | 2025 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), |
| 2026 demuxer_->GetStartTime()); | 2026 demuxer_->GetStartTime()); |
| 2027 } | 2027 } |
| 2028 | 2028 |
| 2029 } // namespace media | 2029 } // namespace media |
| OLD | NEW |