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

Side by Side Diff: media/cdm/aes_decryptor_unittest.cc

Issue 2406073002: EME: Implement Session Closed algorithm (Closed)
Patch Set: 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
OLDNEW
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 #include "media/cdm/aes_decryptor.h" 5 #include "media/cdm/aes_decryptor.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 EmeInitDataType::WEBM, key_id, 327 EmeInitDataType::WEBM, key_id,
328 CreateSessionPromise(RESOLVED)); 328 CreateSessionPromise(RESOLVED));
329 // This expects the promise to be called synchronously, which is the case 329 // This expects the promise to be called synchronously, which is the case
330 // for AesDecryptor. 330 // for AesDecryptor.
331 return session_id_; 331 return session_id_;
332 } 332 }
333 333
334 // Closes the session specified by |session_id|. 334 // Closes the session specified by |session_id|.
335 void CloseSession(const std::string& session_id) { 335 void CloseSession(const std::string& session_id) {
336 EXPECT_CALL(*this, OnSessionClosed(session_id)); 336 EXPECT_CALL(*this, OnSessionClosed(session_id));
337 EXPECT_CALL(*this, OnSessionKeysChangeCalled(session_id, false));
338 cdm_->CloseSession(session_id, CreatePromise(RESOLVED)); 337 cdm_->CloseSession(session_id, CreatePromise(RESOLVED));
339 } 338 }
340 339
341 // Only persistent sessions can be removed. 340 // Only persistent sessions can be removed.
342 void RemoveSession(const std::string& session_id) { 341 void RemoveSession(const std::string& session_id) {
343 // TODO(ddorwin): This should be RESOLVED after https://crbug.com/616166. 342 // TODO(ddorwin): This should be RESOLVED after https://crbug.com/616166.
344 cdm_->RemoveSession(session_id, CreatePromise(REJECTED)); 343 cdm_->RemoveSession(session_id, CreatePromise(REJECTED));
345 } 344 }
346 345
347 MOCK_METHOD2(OnSessionKeysChangeCalled, 346 MOCK_METHOD2(OnSessionKeysChangeCalled,
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 INSTANTIATE_TEST_CASE_P(CdmAdapter, 1024 INSTANTIATE_TEST_CASE_P(CdmAdapter,
1026 AesDecryptorTest, 1025 AesDecryptorTest,
1027 testing::Values("CdmAdapter")); 1026 testing::Values("CdmAdapter"));
1028 #endif 1027 #endif
1029 1028
1030 // TODO(jrummell): Once MojoCdm/MojoCdmService/MojoDecryptor/ 1029 // TODO(jrummell): Once MojoCdm/MojoCdmService/MojoDecryptor/
1031 // MojoDecryptorService are implemented, add a third version that tests the 1030 // MojoDecryptorService are implemented, add a third version that tests the
1032 // CDM via mojo. 1031 // CDM via mojo.
1033 1032
1034 } // namespace media 1033 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698