Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: third_party/WebKit/LayoutTests/media/controls/time-update-after-unload.html

Issue 2499883002: Media Controls: handle 'timeupdate', 'play' and 'pause' via an EventListener. (Closed)
Patch Set: fix repaint test Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/media/controls/time-update-after-unload.html
diff --git a/third_party/WebKit/LayoutTests/media/controls/time-update-after-unload.html b/third_party/WebKit/LayoutTests/media/controls/time-update-after-unload.html
new file mode 100644
index 0000000000000000000000000000000000000000..f1ec7d33edf6218d821a12b3e897300af70e06e6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/controls/time-update-after-unload.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<title>This tests that the controls' current time is updated after media is unloaded</title>
+<script src='../media-file.js'></script>
+<video controls></video>
+<script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ var video = document.querySelector('video');
+ video.src = findMediaFile('video', '../content/test');
+
+ // Get the video into a playing state at currentTime > 0.
+ video.autoplay = true;
+ video.addEventListener('playing', _ => {
+ video.addEventListener('seeked', _ => {
+ // Remove src and reload. The controls should reset and not show a playing
+ // state or currentTime > 0.
+ video.removeAttribute('src');
+ video.load();
+
+ video.addEventListener('emptied', _ => {
+ video.addEventListener('timeupdate', _ => {
+ if (window.testRunner)
+ setTimeout(function() {
+ testRunner.notifyDone();
+ }, 10);
+ });
+ });
+ });
+
+ video.currentTime = 3;
+ }, { once: true });
+</script>
+</html>

Powered by Google App Engine
This is Rietveld 408576698