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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-text-track-destructor-crash.html

Issue 1952893004: Convert track-text-track* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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-text-track-destructor-crash.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-text-track-destructor-crash.html b/third_party/WebKit/LayoutTests/media/track/track-text-track-destructor-crash.html
index fcb54ee8dc4dfce362c83b2a8eb0976310505cae..c32f1dbb39362793bd0dfdee8580395979eac421 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-text-track-destructor-crash.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-text-track-destructor-crash.html
@@ -1,44 +1,18 @@
<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <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>
-
- tracks = [];
-
- function startTest()
- {
- consoleWrite("Create video and add text tracks.");
- var video = document.createElement('video');
- for (var i = 0; i < 1000; i++)
- tracks[i] = video.addTextTrack('captions', 'Captions Track', 'en');
- testExpected("tracks.length", 1000);
- consoleWrite("");
- consoleWrite("Destroy the video and force a garbage collection.");
- video = 0;
- forceGC();
- consoleWrite("SUCCESS: Did not crash");
- endTest();
- }
-
- function forceGC()
- {
- if (window.GCController)
- return GCController.collect();
-
- // Force garbage collection
- for (var ndx = 0; ndx < 99000; ndx++)
- var str = new String("1234");
- }
-
- </script>
- </head>
- <body onload="startTest()">
- <p>Tests that we don't crash when a media element that has text tracks is destructed.</p>
- </body>
-</html>
+<title>Tests that we don't crash when a media element that has text tracks is destructed.</title>
+<script src="../../resources/gc.js"></script>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+async_test(function(t) {
+ var tracks = [];
+ var video = document.createElement('video');
+ for (var i = 0; i < 1000; i++)
+ tracks[i] = video.addTextTrack('captions', 'Captions Track', 'en');
+ assert_equals(tracks.length, 1000);
+ // Destroy the video and force a garbage collection.
+ video = 0;
+ gc();
+ setTimeout(t.step_func_done(), 0);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698