Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setTimeout lint errors around media elements #8026

Merged
merged 1 commit into from
Nov 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -188,7 +188,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