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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-removal-crash.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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/track-removal-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/media/track/track-removal-crash.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-removal-crash.html b/third_party/WebKit/LayoutTests/media/track/track-removal-crash.html
index a36d8c6612f5be1d29ac16b9f6d6c68f5ab0a722..f92c2da199462c8bbb36a893eac293969a45813a 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-removal-crash.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-removal-crash.html
@@ -1,56 +1,35 @@
<!DOCTYPE html>
-<html>
- <head>
- <script src=../media-file.js></script>
- <script src=../media-controls.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>
- function startTest()
- {
- document.getElementsByTagName('track')[0].track.mode = 'showing';
- document.getElementsByTagName('track')[1].track.mode = 'showing';
-
- setTimeout("CFcrash()", 10);
- }
-
- function CFcrash()
- {
- document1 = document.implementation.createDocument("", null);
- document1.appendChild(label1);
-
- delete document1;
-
- setTimeout(runGCAndEndTest, 0);
- }
-
- function runGCAndEndTest()
- {
- gc();
-
- consoleWrite("");
- consoleWrite("No crash. PASS.");
- consoleWrite("");
-
- endTest();
- }
-
- document.addEventListener("DOMContentLoaded", startTest, false);
- </script>
- </head>
-
- <body>
- <p>Tests that removing track nodes while their parent is being deleted doesn't crash</p>
- <label id="label1">
- <video autoplay>
- <!-- Can't use findMediaElement() as test doesn't crash, so source needs to be specified here -->
- <source src="../content/test.ogv">
- <source src="../content/test.mp4">
- <track src="captions-webvtt/captions-fast.vtt">
- <track src="captions-webvtt/captions-fast.vtt">
- </video>
- </label>
- </body>
-</html>
+<title>Tests that removing track nodes while their parent is being deleted doesn't crash</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<label id="label1">
+ <video autoplay>
+ <!-- Can't use findMediaElement() as test doesn't crash, so source needs to be specified here -->
+ <source src="../content/test.ogv">
+ <source src="../content/test.mp4">
+ <track src="captions-webvtt/captions-fast.vtt">
+ <track src="captions-webvtt/captions-fast.vtt">
+ </video>
+</label>
+<script>
+async_test(function(t) {
+ document.getElementsByTagName('track')[0].track.mode = 'showing';
+ document.getElementsByTagName('track')[1].track.mode = 'showing';
+
+ setTimeout(t.step_func(CFcrash), 10);
+
+ function CFcrash() {
+ document1 = document.implementation.createDocument('', null);
+ document1.appendChild(label1);
+
+ delete document1;
+
+ setTimeout(t.step_func_done(runGCAndEndTest), 0);
+ }
+
+ function runGCAndEndTest() {
+ gc();
+ // No crash. PASS.
+ }
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/track-removal-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698