Skip to content

Commit

Permalink
Fix setTimeout lint errors around media elements
Browse files Browse the repository at this point in the history
In activeCues.html, the parenthesis were originally in the wrong place,
causing the function to be called with 0 as this. Fortunately, this
didn't matter. Fixed nonetheless.
  • Loading branch information
foolip committed Nov 1, 2017
1 parent 47a5d6a commit 053e536
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@
var c3 = new VTTCue(0, 2, "text3");
t1.addCue(c3);
assert_equals(t1.activeCues.length, 1, "t1.activeCues.length after adding a cue in the same script");
setTimeout(test3.step_func(function(){
test3.step_timeout(function(){
assert_equals(t1.activeCues.length, 2, "t1.activeCues.length after the event loop has spun");
test3.done();
}, 0));
}, 0);
});
test2.done();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
var e = document.createElement(tagName);
e.src = src;
assert_equals(e.currentSrc, '');
setTimeout(t.step_func(function() {
t.step_timeout(function() {
if (src == '') {
assert_equals(e.currentSrc, '');
} else {
assert_equals(e.currentSrc, e.src);
}
t.done();
}), 0);
}, 0);
}, tagName + '.currentSrc after setting src attribute "' + src + '"');

async_test(function(t) {
Expand All @@ -30,14 +30,14 @@
s.src = src;
e.appendChild(s);
assert_equals(e.currentSrc, '');
setTimeout(t.step_func(function() {
t.step_timeout(function() {
if (src == '') {
assert_equals(e.currentSrc, '');
} else {
assert_equals(e.currentSrc, s.src);
}
t.done();
}), 0);
}, 0);
}, tagName + '.currentSrc after adding source element with src attribute "' + src + '"');
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
assert_false(v.paused, 'paused after playing');
document.querySelector('iframe').contentDocument.body.appendChild(v);
assert_false(v.paused, 'paused after moving');
setTimeout(t.step_func(function() {
t.step_timeout(function() {
assert_false(v.paused, 'paused after stable state')
t.done();
}), 0);
}, 0);
});
v.onpause = t.step_func(function() { assert_unreached(); });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
assert_false(v.paused, 'paused after playing');
document.getElementById('elsewhere').appendChild(v);
assert_false(v.paused, 'paused after moving');
setTimeout(t.step_func(function() {
t.step_timeout(function() {
assert_false(v.paused, 'paused after stable state')
t.done();
}), 0);
}, 0);
});
v.onpause = t.step_func(function() { assert_unreached(); });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
async_test(function(t) {
var v = document.querySelector('video');
v.play();
setTimeout(t.step_func(function() {
t.step_timeout(function() {
assert_equals(v.networkState, v.NETWORK_EMPTY,
'networkState after stable state');
assert_false(v.paused, 'paused after stable state');
v.parentNode.removeChild(v);
assert_false(v.paused, 'paused after removing');
v.onpause = t.step_func(function() { t.done(); });
}), 0);
v.onpause = t.step_func_done();
}, 0);
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
assert_true(v.paused, 'paused in pause event');
// re-insert and verify that it stays paused
document.body.appendChild(v);
setTimeout(t.step_func(function() {
t.step_timeout(function() {
assert_true(v.paused, 'paused after re-inserting');
t.done();
}), 0);
}, 0);
});
}));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@
assert_equals(elm.readyState, elm.NONE, 'elm.readyState after appening to video setting mode');
elm.src = 'resources/track.vtt?pipe=trickle(d1)';
assert_equals(elm.readyState, elm.NONE, 'elm.readyState after setting src');
setTimeout(t.step_func_done(function() {
t.step_timeout(function() {
assert_equals(elm.readyState, elm.LOADING, 'elm.readyState in setTimeout');
var clone = elm.cloneNode(true);
assert_equals(clone.readyState, clone.NONE, 'clone.readyState after element creation');
video.appendChild(clone);
clone.track.mode = 'showing';
assert_equals(clone.readyState, clone.NONE, 'clone.readyState after appending to video and setting mode');
assert_not_equals(clone.track, elm.track, 'clone.track and elm.track');
}), 0);
t.done();
}, 0);
}, document.title+', loading');

async_test(function(t) {
Expand Down
1 change: 0 additions & 1 deletion lint.whitelist
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ SET TIMEOUT: html/dom/documents/resource-metadata-management/document-lastModifi
SET TIMEOUT: html/dom/dynamic-markup-insertion/opening-the-input-stream/*
SET TIMEOUT: html/editing/dnd/*
SET TIMEOUT: html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js
SET TIMEOUT: html/semantics/embedded-content/media-elements/*
SET TIMEOUT: html/semantics/embedded-content/the-iframe-element/*
SET TIMEOUT: html/semantics/embedded-content/the-img-element/*
SET TIMEOUT: html/semantics/forms/textfieldselection/textfieldselection-setRangeText.html
Expand Down

0 comments on commit 053e536

Please sign in to comment.