Bug 1307710 - wpt: Update the getCueAsHTML testcase for testing leading zero of webvtt timestamp object. r=rillian
MozReview-Commit-ID: BQPugEkRCP0
--- a/testing/web-platform/tests/webvtt/webvtt-api-for-browsers/vttcue-interface/getCueAsHTML.html
+++ b/testing/web-platform/tests/webvtt/webvtt-api-for-browsers/vttcue-interface/getCueAsHTML.html
@@ -3,17 +3,17 @@
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<script>
test(function(){
var video = document.createElement('video');
var t1 = video.addTextTrack('subtitles');
document.body.appendChild(video);
- var c1 = new VTTCue(0, 1, '<c></c><c.a.b></c><i></i><b></b><u></u><ruby><rt></rt></ruby><v></v><v a b></v><00:00:00.500>x\0');
+ var c1 = new VTTCue(0, 1, '<c></c><c.a.b></c><i></i><b></b><u></u><ruby><rt></rt></ruby><v></v><v a b></v><1:00:00.500>x\0');
t1.addCue(c1);
window.frag = c1.getCueAsHTML();
assert_equals(frag.childNodes.length, 10, 'childNodes.length');
assert_true(frag instanceof DocumentFragment, 'getCueAsHTML() should return DocumentFragment');
}, document.title+', creating the cue');
test(function(){
assert_equals(frag.childNodes[0].namespaceURI, 'http://www.w3.org/1999/xhtml', 'namespaceURI');
assert_equals(frag.childNodes[0].localName, 'span', 'localName');
@@ -77,16 +77,16 @@ test(function(){
assert_equals(frag.childNodes[7].localName, 'span', 'localName');
assert_equals(frag.childNodes[7].attributes.length, 1, 'attributes');
assert_equals(frag.childNodes[7].getAttributeNS('', 'title'), 'a b', 'title attribute');
assert_false(frag.childNodes[7].hasChildNodes(), 'hasChildNodes()');
assert_true(frag.childNodes[7] instanceof HTMLElement, 'instanceof');
}, document.title+', <v a b>');
test(function(){
assert_equals(frag.childNodes[8].target, 'timestamp', 'target');
- assert_equals(frag.childNodes[8].data, '00:00:00.500', 'data');
+ assert_equals(frag.childNodes[8].data, '01:00:00.500', 'data');
assert_true(frag.childNodes[8] instanceof ProcessingInstruction, 'instanceof');
-}, document.title+', <00:00:00.500>');
+}, document.title+', <1:00:00.500>');
test(function(){
assert_equals(frag.childNodes[9].data, 'x\0', 'data');
assert_true(frag.childNodes[9] instanceof Text, 'instanceof');
}, document.title+', x\\0');
</script>