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

Unified Diff: LayoutTests/http/tests/media/media-source/mediasource-trackdefault.html

Issue 1110223002: Use and add layout tests for BCP 47 language tag syntax validation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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/http/tests/media/media-source/mediasource-trackdefault-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/media/media-source/mediasource-trackdefault.html
diff --git a/LayoutTests/http/tests/media/media-source/mediasource-trackdefault.html b/LayoutTests/http/tests/media/media-source/mediasource-trackdefault.html
index 61dcd786e194baed09f04f75c7706accf63e62ac..008082a72fa9b9939d2c87f487571ee4f943f59d 100644
--- a/LayoutTests/http/tests/media/media-source/mediasource-trackdefault.html
+++ b/LayoutTests/http/tests/media/media-source/mediasource-trackdefault.html
@@ -19,9 +19,9 @@
assert_array_equals(trackDefault.kinds, kinds, "kinds");
}
- function checkConstructionFails(type, language, label, kinds, byteStreamTrackID)
+ function checkConstructionFails(type, language, label, kinds, byteStreamTrackID, expectedException)
{
- assert_throws(new TypeError(),
+ assert_throws(expectedException,
function() { new TrackDefault(type, language, label, kinds, byteStreamTrackID); },
"TrackDefault construction threw an exception");
}
@@ -33,7 +33,7 @@
if (expectation)
checkConstructionSucceeds(type, language, label, kinds, byteStreamTrackID);
else
- checkConstructionFails(type, language, label, kinds, byteStreamTrackID);
+ checkConstructionFails(type, language, label, kinds, byteStreamTrackID, new TypeError());
}, description + ": type '" + type + "', language '" + language + "', label '" + label + "', multiple kinds, byteStreamTrackID '" + byteStreamTrackID + "'");
// If all of |kinds| are expected to succeed, also test each kind individually.
@@ -91,7 +91,13 @@
test(function()
{
- checkConstructionFails("audio", "en-US", "label", "this is not a valid sequence", "1");
+ checkConstructionFails("audio", "invalid language", "audio label", VALID_AUDIO_TRACK_KINDS, "1", 'InvalidAccessError');
+
+ }, "Test invalid 'language' parameter syntax passed to TrackDefault constructor");
+
+ test(function()
+ {
+ checkConstructionFails("audio", "en-US", "label", "this is not a valid sequence", "1", new TypeError());
}, "Test invalid 'kinds' parameter type passed to TrackDefault constructor");
test(function()
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/media-source/mediasource-trackdefault-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698