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

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

Issue 2831963003: EME: Allow temporary sessions to be removed for ClearKey only. (Closed)
Patch Set: rebase Created 3 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
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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 EXPECT_EQ(current_session_id_, session_id); 262 EXPECT_EQ(current_session_id_, session_id);
263 } 263 }
264 264
265 void OnSessionKeysChange(const std::string& session_id, 265 void OnSessionKeysChange(const std::string& session_id,
266 bool has_additional_usable_key, 266 bool has_additional_usable_key,
267 CdmKeysInfo keys_info) override { 267 CdmKeysInfo keys_info) override {
268 EXPECT_EQ(current_session_id_, session_id); 268 EXPECT_EQ(current_session_id_, session_id);
269 EXPECT_EQ(has_additional_usable_key, true); 269 EXPECT_EQ(has_additional_usable_key, true);
270 } 270 }
271 271
272 void OnSessionExpirationUpdate(const std::string& session_id,
273 base::Time new_expiry_time) override {
274 EXPECT_EQ(current_session_id_, session_id);
275 }
276
272 void OnEncryptedMediaInitData(EmeInitDataType init_data_type, 277 void OnEncryptedMediaInitData(EmeInitDataType init_data_type,
273 const std::vector<uint8_t>& init_data, 278 const std::vector<uint8_t>& init_data,
274 AesDecryptor* decryptor) override { 279 AesDecryptor* decryptor) override {
275 // Since only 1 session is created, skip the request if the |init_data| 280 // Since only 1 session is created, skip the request if the |init_data|
276 // has been seen before (no need to add the same key again). 281 // has been seen before (no need to add the same key again).
277 if (init_data == prev_init_data_) 282 if (init_data == prev_init_data_)
278 return; 283 return;
279 prev_init_data_ = init_data; 284 prev_init_data_ = init_data;
280 285
281 if (current_session_id_.empty()) { 286 if (current_session_id_.empty()) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 FAIL() << "Unexpected Closed"; 350 FAIL() << "Unexpected Closed";
346 } 351 }
347 352
348 void OnSessionKeysChange(const std::string& session_id, 353 void OnSessionKeysChange(const std::string& session_id,
349 bool has_additional_usable_key, 354 bool has_additional_usable_key,
350 CdmKeysInfo keys_info) override { 355 CdmKeysInfo keys_info) override {
351 EXPECT_FALSE(session_id.empty()); 356 EXPECT_FALSE(session_id.empty());
352 EXPECT_EQ(has_additional_usable_key, true); 357 EXPECT_EQ(has_additional_usable_key, true);
353 } 358 }
354 359
360 void OnSessionExpirationUpdate(const std::string& session_id,
361 base::Time new_expiry_time) override {}
362
355 void OnEncryptedMediaInitData(EmeInitDataType init_data_type, 363 void OnEncryptedMediaInitData(EmeInitDataType init_data_type,
356 const std::vector<uint8_t>& init_data, 364 const std::vector<uint8_t>& init_data,
357 AesDecryptor* decryptor) override {} 365 AesDecryptor* decryptor) override {}
358 }; 366 };
359 367
360 // A rough simulation of GpuVideoDecoder that fails every Decode() request. This 368 // A rough simulation of GpuVideoDecoder that fails every Decode() request. This
361 // is used to test post-Initialize() fallback paths. 369 // is used to test post-Initialize() fallback paths.
362 class FailingVideoDecoder : public VideoDecoder { 370 class FailingVideoDecoder : public VideoDecoder {
363 public: 371 public:
364 std::string GetDisplayName() const override { return "FailingVideoDecoder"; } 372 std::string GetDisplayName() const override { return "FailingVideoDecoder"; }
(...skipping 1985 matching lines...) Expand 10 before | Expand all | Expand 10 after
2350 2358
2351 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { 2359 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) {
2352 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); 2360 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm"));
2353 Play(); 2361 Play();
2354 ASSERT_TRUE(WaitUntilOnEnded()); 2362 ASSERT_TRUE(WaitUntilOnEnded());
2355 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), 2363 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000),
2356 demuxer_->GetStartTime()); 2364 demuxer_->GetStartTime());
2357 } 2365 }
2358 2366
2359 } // namespace media 2367 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698