OLD | NEW |
1 | 1 |
2 var currentTest = null; | 2 var currentTest = null; |
3 var fragmentEndTime; | 3 var fragmentEndTime; |
4 var testData = | 4 var testData = |
5 { | 5 { |
6 // http://www.w3.org/2008/WebVideo/Fragments/TC/ua-test-cases | 6 // http://www.w3.org/2008/WebVideo/Fragments/TC/ua-test-cases |
7 | 7 |
8 TC0001 : { start: null, end: null, valid: false, description: "#t=,", fr
agment: "t=,", comment: "Syntax error, not allowed according to the ABNF. The me
dia fragment is ignored."}, | 8 TC0001 : { start: null, end: null, valid: false, description: "#t=,", fr
agment: "t=,", comment: "Syntax error, not allowed according to the ABNF. The me
dia fragment is ignored."}, |
9 TC0002 : { start: null, end: null, valid: false, description: "#t=a,a an
d a >= 0", fragment: "t=3,3", comment: "Invalid semantics: start must be smaller
than end. The media fragment is ignored."}, | 9 TC0002 : { start: null, end: null, valid: false, description: "#t=a,a an
d a >= 0", fragment: "t=3,3", comment: "Invalid semantics: start must be smaller
than end. The media fragment is ignored."}, |
10 TC0003 : { start: null, end: null, valid: false, description: "#t=a,b an
d a > b", fragment: "t=7,3", comment: "Invalid semantics: the requested interval
's start is beyond its end. The media fragment is ignored."}, | 10 TC0003 : { start: null, end: null, valid: false, description: "#t=a,b an
d a > b", fragment: "t=7,3", comment: "Invalid semantics: the requested interval
's start is beyond its end. The media fragment is ignored."}, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 fragmentEndTime = info.end ? info.end : duration; | 92 fragmentEndTime = info.end ? info.end : duration; |
93 | 93 |
94 if (start == "duration") | 94 if (start == "duration") |
95 start = duration; | 95 start = duration; |
96 if (fragmentEndTime == "duration") | 96 if (fragmentEndTime == "duration") |
97 fragmentEndTime = duration; | 97 fragmentEndTime = duration; |
98 | 98 |
99 // Don't use "testExpected()" so we won't log the actual duration as the
floating point result may differ with different engines. | 99 // Don't use "testExpected()" so we won't log the actual duration as the
floating point result may differ with different engines. |
100 var startString = info.start == "duration" ? "duration" : start; | 100 var startString = info.start == "duration" ? "duration" : start; |
101 reportExpected(video.currentTime.toFixed(2) == start, "video.currentTime
", "==", startString, video.currentTime); | 101 reportExpected(video.currentTime.toFixed(2) == start, "video.currentTime
", "==", startString, video.currentTime); |
102 reportExpected(video.initialTime.toFixed(2) == start, "video.initialTime
", "==", startString, video.initialTime); | |
103 | 102 |
104 if (info.valid) { | 103 if (info.valid) { |
105 video.currentTime = (fragmentEndTime - 0.5); | 104 video.currentTime = (fragmentEndTime - 0.5); |
106 run("video.play()"); | 105 run("video.play()"); |
107 } else | 106 } else |
108 endTest(); | 107 endTest(); |
109 } | 108 } |
110 | 109 |
111 function start() | 110 function start() |
112 { | 111 { |
(...skipping 12 matching lines...) Expand all Loading... |
125 var fileName = location.href.split('/').pop(); | 124 var fileName = location.href.split('/').pop(); |
126 currentTest = fileName.substring(0, fileName.lastIndexOf(".")); | 125 currentTest = fileName.substring(0, fileName.lastIndexOf(".")); |
127 | 126 |
128 var info = testData[currentTest]; | 127 var info = testData[currentTest]; |
129 consoleWrite("<br>Title: <b>" + currentTest + "</b>"); | 128 consoleWrite("<br>Title: <b>" + currentTest + "</b>"); |
130 consoleWrite("Fragment: '<i>" + info.fragment + "</i>'"); | 129 consoleWrite("Fragment: '<i>" + info.fragment + "</i>'"); |
131 consoleWrite("Comment: <i>" + info.comment + "</i>"); | 130 consoleWrite("Comment: <i>" + info.comment + "</i>"); |
132 url = findMediaFile("video", "../content/counting") + "#" + info.fragmen
t; | 131 url = findMediaFile("video", "../content/counting") + "#" + info.fragmen
t; |
133 video.src = url; | 132 video.src = url; |
134 } | 133 } |
OLD | NEW |