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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-remove-by-setting-innerHTML.html

Issue 1950283002: Convert track-remove* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 7 months 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/track/track-remove-by-setting-innerHTML.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-remove-by-setting-innerHTML.html b/third_party/WebKit/LayoutTests/media/track/track-remove-by-setting-innerHTML.html
index 5bb761107ee2caac2917d609f11ba1364f13f0c0..040baed58f5a353f1ad1ae8775aa7352687a7b13 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-remove-by-setting-innerHTML.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-remove-by-setting-innerHTML.html
@@ -1,48 +1,31 @@
-<!doctype html>
-<html>
- <head>
- <script src="../media-file.js"></script>
- <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
- (Please avoid writing new tests using video-test.js) -->
- <script src="../video-test.js"></script>
- <script type="text/javascript">
- var firstSeek = true;
+<!DOCTYPE html>
+<title>This test makes sure that removing a track by setting video.innerHTML doesn't crash (https://bugs.webkit.org/show_bug.cgi?id=100981). If this test does not crash, it passes.</title>
+<script src="../media-file.js"></script>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<video>
+ <track default="" src="captions-webvtt/captions-gaps.vtt">
+</video>
+</div>
+<script>
+async_test(function(t) {
+ var firstSeek = true;
+ var video = document.querySelector('video');
+ video.onseeked = t.step_func(function() {
+ if (!firstSeek) {
+ t.done();
+ return;
+ }
- function seeked()
- {
- if (!firstSeek) {
- endTest();
- return;
- }
+ // Remove the text track
+ video.innerHTML = '';
- // Remove the text tra
- video.innerHTML = "This is a test";
-
- // Seek again to force a repaint.
- run("video.currentTime = 7.9");
- firstSeek = false;
- }
-
- function loaded()
- {
- findMediaElement();
- waitForEvent('error');
- waitForEvent('seeked', seeked);
- waitForEventOnce('canplaythrough', function()
- {
- video.currentTime = 0.5;
- });
- video.src = findMediaFile('video', '../content/counting');
- }
- </script>
- </head>
- <body onload=loaded()>
- <video>
- <track default="" src="captions-webvtt/captions-gaps.vtt">
- </video>
- <div>
- This test makes sure that removing a track by setting video.innerHTML doesn't crash (https://bugs.webkit.org/show_bug.cgi?id=100981).
- <p>If this test does not crash, it passes.</p>
- </div>
- </body>
-</html>
+ // Seek again to force a repaint.
+ video.currentTime = 7.9;
+ firstSeek = false;
+ });
+
+ video.currentTime = 0.5;
+ video.src = findMediaFile('video', '../content/counting');
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698