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

Unified Diff: LayoutTests/media/track/track-cue-empty-crash.html

Issue 22304002: Crash when calling getCueAsHTML() on a TextTrackCue with empty text (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 7 years, 4 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/track-cue-empty-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/media/track/track-cue-empty-crash.html
diff --git a/LayoutTests/media/track/track-cue-empty-crash.html b/LayoutTests/media/track/track-cue-empty-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..62e42d825372a42f2cd1d523c820b91cb93ac255
--- /dev/null
+++ b/LayoutTests/media/track/track-cue-empty-crash.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Julien - ping for review 2013/08/09 20:12:12 Usually meta tags are removed unless useful for th
+
+ <script src=../media-file.js></script>
+ <script src=../video-test.js></script>
+ <script>
+ var fragment;
+ function startTest()
+ {
+ var emptyCue = new TextTrackCue(0, 0, "");
+ fragment = emptyCue.getCueAsHTML();
+
+ consoleWrite("** The getCueAsHTML() method should return a document fragment **");
+ testExpected("fragment", null, "!=");
+
+ consoleWrite("<br>** The document fragment should have one child, an empty Text node **");
+ testExpected("fragment.childNodes.length", 1);
+ testExpected("fragment.childNodes[0].constructor.name", Text.name);
+ testExpected("fragment.childNodes[0].length", 0);
+
+ consoleWrite("");
+ consoleWrite("No crash. PASS.");
+ consoleWrite("");
+
+ endTest();
+ }
+ </script>
+ </head>
+
+ <body onload="startTest()">
+ <p>Tests that having an empty cue does not crash when calling getCueAsHTML().</p>
+ <video controls />
+ </body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/media/track/track-cue-empty-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698