| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="/w3c/resources/testharness.js"></script> | 4 <script src="/w3c/resources/testharness.js"></script> |
| 5 <script src="/w3c/resources/testharnessreport.js"></script> | 5 <script src="/w3c/resources/testharnessreport.js"></script> |
| 6 <script src="mediasource-util.js"></script> | 6 <script src="mediasource-util.js"></script> |
| 7 <link rel='stylesheet' href='/w3c/resources/testharness.css'> | 7 <link rel='stylesheet' href='/w3c/resources/testharness.css'> |
| 8 </head> | 8 </head> |
| 9 <body> | 9 <body> |
| 10 <div id="log"></div> | 10 <div id="log"></div> |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 test.expectEvent(mediaSource, 'sourceopen', 'Source attached again
'); | 101 test.expectEvent(mediaSource, 'sourceopen', 'Source attached again
'); |
| 102 mediaElement.src = URL.createObjectURL(mediaSource); | 102 mediaElement.src = URL.createObjectURL(mediaSource); |
| 103 assert_equals(mediaSource.readyState, 'closed', 'Source closed'); | 103 assert_equals(mediaSource.readyState, 'closed', 'Source closed'); |
| 104 | 104 |
| 105 test.waitForExpectedEvents(function() | 105 test.waitForExpectedEvents(function() |
| 106 { | 106 { |
| 107 assert_equals(mediaSource.readyState, 'open', 'Source reopened
'); | 107 assert_equals(mediaSource.readyState, 'open', 'Source reopened
'); |
| 108 test.done(); | 108 test.done(); |
| 109 }); | 109 }); |
| 110 }, 'Test that MediaSource can reattach if closed first'); | 110 }, 'Test that MediaSource can reattach if closed first'); |
| 111 |
| 112 mediasource_test(function(test, mediaElement, mediaSource) { |
| 113 assert_equals(mediaSource.readyState, 'open', 'Source open'); |
| 114 // Generate two different unique URLs for MediaSource |
| 115 var url1 = URL.createObjectURL(mediaSource); |
| 116 var url2 = URL.createObjectURL(mediaSource); |
| 117 assert_not_equals(url1, url2, 'URLs not unique'); |
| 118 // Revoke the first url |
| 119 URL.revokeObjectURL(url1); |
| 120 // And use the second, non-revoked URL to reopen the media source |
| 121 test.expectEvent(mediaSource, 'sourceopen', 'Source reopened'); |
| 122 mediaElement.src = url2; |
| 123 assert_equals(mediaSource.readyState, 'closed', 'Source closed'); |
| 124 test.waitForExpectedEvents(function() |
| 125 { |
| 126 assert_equals(mediaSource.readyState, 'open', 'Source opened')
; |
| 127 test.done(); |
| 128 }); |
| 129 }, 'Generate multiple unique URLs via URL.createObjectURL and revoke a
n URL'); |
| 111 </script> | 130 </script> |
| 112 </body> | 131 </body> |
| 113 </html> | 132 </html> |
| OLD | NEW |