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 26 matching lines...) Expand all Loading... |
37 // Random key ID used to create a session. | 37 // Random key ID used to create a session. |
38 const uint8_t kKeyId[] = { | 38 const uint8_t kKeyId[] = { |
39 // base64 equivalent is AQIDBAUGBwgJCgsMDQ4PEA | 39 // base64 equivalent is AQIDBAUGBwgJCgsMDQ4PEA |
40 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, | 40 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, |
41 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, | 41 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, |
42 }; | 42 }; |
43 | 43 |
44 const char kKeyIdAsJWK[] = "{\"kids\": [\"AQIDBAUGBwgJCgsMDQ4PEA\"]}"; | 44 const char kKeyIdAsJWK[] = "{\"kids\": [\"AQIDBAUGBwgJCgsMDQ4PEA\"]}"; |
45 | 45 |
46 const uint8_t kKeyIdAsPssh[] = { | 46 const uint8_t kKeyIdAsPssh[] = { |
47 0x00, 0x00, 0x00, 0x00, 'p', 's', 's', 'h', // size = 0 | 47 0x00, 0x00, 0x00, 0x34, // size = 52 |
| 48 'p', 's', 's', 'h', // 'pssh' |
48 0x01, // version = 1 | 49 0x01, // version = 1 |
49 0x00, 0x00, 0x00, // flags | 50 0x00, 0x00, 0x00, // flags |
50 0x10, 0x77, 0xEF, 0xEC, 0xC0, 0xB2, 0x4D, 0x02, // Common SystemID | 51 0x10, 0x77, 0xEF, 0xEC, 0xC0, 0xB2, 0x4D, 0x02, // Common SystemID |
51 0xAC, 0xE3, 0x3C, 0x1E, 0x52, 0xE2, 0xFB, 0x4B, | 52 0xAC, 0xE3, 0x3C, 0x1E, 0x52, 0xE2, 0xFB, 0x4B, |
52 0x00, 0x00, 0x00, 0x01, // key count | 53 0x00, 0x00, 0x00, 0x01, // key count |
53 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, // key | 54 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, // key |
54 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, | 55 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, |
55 0x00, 0x00, 0x00, 0x00, // datasize | 56 0x00, 0x00, 0x00, 0x00, // datasize |
56 }; | 57 }; |
57 | 58 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 TEST_F(CdmAdapterTest, UpdateSessionWithBadData) { | 324 TEST_F(CdmAdapterTest, UpdateSessionWithBadData) { |
324 InitializeAndExpect(ExternalClearKeyLibrary(), SUCCESS); | 325 InitializeAndExpect(ExternalClearKeyLibrary(), SUCCESS); |
325 | 326 |
326 std::vector<uint8_t> key_id(kKeyId, kKeyId + arraysize(kKeyId)); | 327 std::vector<uint8_t> key_id(kKeyId, kKeyId + arraysize(kKeyId)); |
327 CreateSessionAndExpect(EmeInitDataType::WEBM, key_id, SUCCESS); | 328 CreateSessionAndExpect(EmeInitDataType::WEBM, key_id, SUCCESS); |
328 | 329 |
329 UpdateSessionAndExpect(SessionId(), "random data", FAILURE, true); | 330 UpdateSessionAndExpect(SessionId(), "random data", FAILURE, true); |
330 } | 331 } |
331 | 332 |
332 } // namespace media | 333 } // namespace media |
OLD | NEW |