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

Unified Diff: LayoutTests/media/track/opera/interfaces/VTTCue/constructor.html

Issue 854863002: VTTCue: Add TypeChecking=Unrestricted (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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: LayoutTests/media/track/opera/interfaces/VTTCue/constructor.html
diff --git a/LayoutTests/media/track/opera/interfaces/VTTCue/constructor.html b/LayoutTests/media/track/opera/interfaces/VTTCue/constructor.html
new file mode 100644
index 0000000000000000000000000000000000000000..4cb6729214ee48246a40e0100641e0101b313e73
--- /dev/null
+++ b/LayoutTests/media/track/opera/interfaces/VTTCue/constructor.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<title>VTTCue constructor</title>
+<script src=../../../../../resources/testharness.js></script>
+<script src=../../../../../resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function() {
+ assert_throws(new TypeError, function() { new VTTCue(NaN, 0, 'foo'); });
+ assert_throws(new TypeError, function() { new VTTCue(Infinity, 0, 'foo'); });
+ assert_throws(new TypeError, function() { new VTTCue('tomorrow', 'christmas', 'foo'); });
philipj_slow 2015/01/19 08:49:36 s/christmas/0/ unless I'm missing a reason.
fs 2015/01/19 10:18:16 Yes, this was just my fun-loving (pun-loving?) sid
+}, document.title+', non-finite start time');
+test(function() {
+ assert_throws(new TypeError, function() { new VTTCue(0, NaN, 'foo'); });
+ assert_throws(new TypeError, function() { new VTTCue(0, Infinity, 'foo'); });
+ assert_throws(new TypeError, function() { new VTTCue(0, 'tomorrow', 'foo'); });
+}, document.title+', non-finite end time');
+test(function() {
+ var start = { valueOf: function() { return 42; } };
+ var end = { valueOf: function() { return 84; } };
+ var cue = new VTTCue(start, end, 'bar');
+ assert_equals(cue.startTime, 42);
+ assert_equals(cue.endTime, 84);
+ assert_equals(cue.text, 'bar');
+}, document.title+', valueOf');
+</script>
« no previous file with comments | « no previous file | LayoutTests/media/track/track-add-remove-cue.html » ('j') | LayoutTests/media/track/track-add-remove-cue.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698