| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Waiting for a key.</title> | 4 <title>Waiting for a key.</title> |
| 5 <script src="encrypted-media-utils.js"></script> | 5 <script src="encrypted-media-utils.js"></script> |
| 6 <script src="../w3c-media-utils.js"></script> | 6 <script src="../w3c-media-utils.js"></script> |
| 7 <script src="../../resources/testharness.js"></script> | 7 <script src="../../resources/testharness.js"></script> |
| 8 <script src="../../resources/testharnessreport.js"></script> | 8 <script src="../../resources/testharnessreport.js"></script> |
| 9 </head> | 9 </head> |
| 10 <body> | 10 <body> |
| 11 <video id="testVideo"></video> | 11 <video id="testVideo"></video> |
| 12 <div id="log"></div> | 12 <div id="log"></div> |
| 13 <script> | 13 <script> |
| 14 // Timeout for all tests to run. |
| 15 setup({ timeout: 60000 }); |
| 16 |
| 14 async_test(function(test) | 17 async_test(function(test) |
| 15 { | 18 { |
| 16 var video = document.getElementById("testVideo"); | 19 var video = document.getElementById("testVideo"); |
| 17 var mediaKeys = new MediaKeys("org.w3.clearkey"); | 20 var mediaKeys = new MediaKeys("org.w3.clearkey"); |
| 18 var mediaKeySession = null; | 21 var mediaKeySession = null; |
| 19 var sessionReadyReceived = false; | 22 var sessionReadyReceived = false; |
| 20 | 23 |
| 21 var keyId = null; | 24 var keyId = null; |
| 22 var rawKey = new Uint8Array([0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14,
0xd2, 0x7b, | 25 var rawKey = new Uint8Array([0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14,
0xd2, 0x7b, |
| 23 0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4,
0xae, 0x3c]); | 26 0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4,
0xae, 0x3c]); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 88 |
| 86 test.done(); | 89 test.done(); |
| 87 } | 90 } |
| 88 | 91 |
| 89 waitForEventAndRunStep("needkey", video, onNeedKey, test); | 92 waitForEventAndRunStep("needkey", video, onNeedKey, test); |
| 90 waitForEventAndRunStep("playing", video, onPlaying, test); | 93 waitForEventAndRunStep("playing", video, onPlaying, test); |
| 91 | 94 |
| 92 video.src = "../content/test-encrypted.webm"; | 95 video.src = "../content/test-encrypted.webm"; |
| 93 video.setMediaKeys(mediaKeys); | 96 video.setMediaKeys(mediaKeys); |
| 94 video.play(); | 97 video.play(); |
| 95 }, "Waiting for a key."); | 98 }, "Waiting for a key.", { timeout: 60000 }); |
| 96 </script> | 99 </script> |
| 97 </body> | 100 </body> |
| 98 </html> | 101 </html> |
| OLD | NEW |