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

Unified Diff: LayoutTests/media/track/media-element-enqueue-event-crash.html

Issue 15739014: Avoid referencing an HTMLMediaElement if is currently being deleted (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed build error again Created 7 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 | LayoutTests/media/track/media-element-enqueue-event-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/media/track/media-element-enqueue-event-crash.html
diff --git a/LayoutTests/media/track/media-element-enqueue-event-crash.html b/LayoutTests/media/track/media-element-enqueue-event-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..2415c7f8d19e7d832cac8dc5aceb85528fc7d0ee
--- /dev/null
+++ b/LayoutTests/media/track/media-element-enqueue-event-crash.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src=../media-file.js></script>
+ <script src=../media-controls.js></script>
+ <script src=../video-test.js></script>
+
+ <script>
+ if (window.testRunner)
+ {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ function startTest()
+ {
+ if (localStorage.testRuns)
+ localStorage.testRuns = Number(localStorage.testRuns) + 1;
+ else {
+ localStorage.testRuns = 1;
+ localStorage.totalRuns = 5;
+ }
+
+ document.getElementsByTagName('track')[0].track.mode = 'showing';
+ setTimeout(CFcrash, 100);
+ }
+
+ function forceGC() {
+ gc();
+
+ // End the test only if it ran at least totalRuns.
+ if (window.testRunner && localStorage.testRuns == localStorage.totalRuns) {
+ consoleWrite("** No crash. Pass **");
+ testRunner.notifyDone();
+ } else
+ window.location.reload();
+ }
+
+ function CFcrash()
+ {
+ document1 = document.implementation.createDocument("", null);
+ document1.appendChild(videoElement);
+ delete document1;
+
+ setTimeout(forceGC, 0);
+ }
+
+ document.addEventListener("DOMContentLoaded", startTest, false);
+ </script>
+ </head>
+
+ <body>
+ <p>Tests that appending events for dispatching doesn't crash</p>
+ <video autoplay id="videoElement">
+ <source src="../content/test.ogv">
+ <source src="../content/test.mp4">
+ <track src="captions-webvtt/captions-fast.vtt" default>
+ </video>
+ </body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/media/track/media-element-enqueue-event-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698