| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/cdm_adapter.h" | 5 #include "media/cdm/cdm_adapter.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 206 |
| 207 std::unique_ptr<CdmFileIO> CreateCdmFileIO(cdm::FileIOClient* client) { | 207 std::unique_ptr<CdmFileIO> CreateCdmFileIO(cdm::FileIOClient* client) { |
| 208 ADD_FAILURE() << "Should never be called"; | 208 ADD_FAILURE() << "Should never be called"; |
| 209 return nullptr; | 209 return nullptr; |
| 210 } | 210 } |
| 211 | 211 |
| 212 // Methods used for promise resolved/rejected. | 212 // Methods used for promise resolved/rejected. |
| 213 MOCK_METHOD0(OnResolve, void()); | 213 MOCK_METHOD0(OnResolve, void()); |
| 214 MOCK_METHOD1(OnResolveWithSession, void(const std::string& session_id)); | 214 MOCK_METHOD1(OnResolveWithSession, void(const std::string& session_id)); |
| 215 MOCK_METHOD3(OnReject, | 215 MOCK_METHOD3(OnReject, |
| 216 void(MediaKeys::Exception exception_code, | 216 void(CdmPromise::Exception exception_code, |
| 217 uint32_t system_code, | 217 uint32_t system_code, |
| 218 const std::string& error_message)); | 218 const std::string& error_message)); |
| 219 | 219 |
| 220 // Methods used for the events possibly generated by CdmAdapater. | 220 // Methods used for the events possibly generated by CdmAdapater. |
| 221 MOCK_METHOD3(OnSessionMessage, | 221 MOCK_METHOD3(OnSessionMessage, |
| 222 void(const std::string& session_id, | 222 void(const std::string& session_id, |
| 223 MediaKeys::MessageType message_type, | 223 MediaKeys::MessageType message_type, |
| 224 const std::vector<uint8_t>& message)); | 224 const std::vector<uint8_t>& message)); |
| 225 MOCK_METHOD1(OnSessionClosed, void(const std::string& session_id)); | 225 MOCK_METHOD1(OnSessionClosed, void(const std::string& session_id)); |
| 226 MOCK_METHOD2(OnSessionKeysChangeCalled, | 226 MOCK_METHOD2(OnSessionKeysChangeCalled, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 TEST_F(CdmAdapterTest, UpdateSessionWithBadData) { | 315 TEST_F(CdmAdapterTest, UpdateSessionWithBadData) { |
| 316 InitializeAndExpect(ExternalClearKeyLibrary(), SUCCESS); | 316 InitializeAndExpect(ExternalClearKeyLibrary(), SUCCESS); |
| 317 | 317 |
| 318 std::vector<uint8_t> key_id(kKeyId, kKeyId + arraysize(kKeyId)); | 318 std::vector<uint8_t> key_id(kKeyId, kKeyId + arraysize(kKeyId)); |
| 319 CreateSessionAndExpect(EmeInitDataType::WEBM, key_id, SUCCESS); | 319 CreateSessionAndExpect(EmeInitDataType::WEBM, key_id, SUCCESS); |
| 320 | 320 |
| 321 UpdateSessionAndExpect(SessionId(), "random data", FAILURE, true); | 321 UpdateSessionAndExpect(SessionId(), "random data", FAILURE, true); |
| 322 } | 322 } |
| 323 | 323 |
| 324 } // namespace media | 324 } // namespace media |
| OLD | NEW |