| OLD | NEW |
| 1 // Extract & return the resolution string from a filename, if any. | 1 // Extract & return the resolution string from a filename, if any. |
| 2 function resolutionFromFilename(filename) | 2 function resolutionFromFilename(filename) |
| 3 { | 3 { |
| 4 resolution = filename.replace(/^.*[^0-9]([0-9]+x[0-9]+)[^0-9].*$/, "$1"); | 4 resolution = filename.replace(/^.*[^0-9]([0-9]+x[0-9]+)[^0-9].*$/, "$1"); |
| 5 if (resolution != filename) { | 5 if (resolution != filename) { |
| 6 return resolution; | 6 return resolution; |
| 7 } | 7 } |
| 8 return ""; | 8 return ""; |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 { | 57 { |
| 58 // Add the second buffer starting at 1.5 second. | 58 // Add the second buffer starting at 1.5 second. |
| 59 sourceBuffer.timestampOffset = 1.5; | 59 sourceBuffer.timestampOffset = 1.5; |
| 60 appendBuffer(test, sourceBuffer, dataB); | 60 appendBuffer(test, sourceBuffer, dataB); |
| 61 ++expectedResizeEventCount; | 61 ++expectedResizeEventCount; |
| 62 }); | 62 }); |
| 63 | 63 |
| 64 test.waitForExpectedEvents(function() | 64 test.waitForExpectedEvents(function() |
| 65 { | 65 { |
| 66 // Truncate the presentation to a duration of 2 seconds. | 66 // Truncate the presentation to a duration of 2 seconds. |
| 67 assert_false(sourceBuffer.updating, "sourceBuffer.updating")
; |
| 68 |
| 67 mediaSource.duration = 2; | 69 mediaSource.duration = 2; |
| 70 |
| 71 assert_true(sourceBuffer.updating, "sourceBuffer.updating"); |
| 72 test.expectEvent(sourceBuffer, "updatestart"); |
| 73 test.expectEvent(sourceBuffer, "update"); |
| 74 test.expectEvent(sourceBuffer, "updateend"); |
| 75 }); |
| 76 |
| 77 test.waitForExpectedEvents(function() |
| 78 { |
| 68 mediaSource.endOfStream(); | 79 mediaSource.endOfStream(); |
| 69 | 80 |
| 70 if (expectResizeEvents) { | 81 if (expectResizeEvents) { |
| 71 for (var i = 0; i < expectedResizeEventCount; ++i) { | 82 for (var i = 0; i < expectedResizeEventCount; ++i) { |
| 72 test.expectEvent(mediaElement, "resize"); | 83 test.expectEvent(mediaElement, "resize"); |
| 73 } | 84 } |
| 74 } | 85 } |
| 75 test.expectEvent(mediaElement, "ended"); | 86 test.expectEvent(mediaElement, "ended"); |
| 76 mediaElement.play(); | 87 mediaElement.play(); |
| 77 }); | 88 }); |
| 78 | 89 |
| 79 test.waitForExpectedEvents(function() { | 90 test.waitForExpectedEvents(function() { |
| 80 test.done(); | 91 test.done(); |
| 81 }); | 92 }); |
| 82 }); | 93 }); |
| 83 }); | 94 }); |
| 84 }, description, { timeout: 10000 } ); | 95 }, description, { timeout: 10000 } ); |
| 85 }; | 96 }; |
| OLD | NEW |