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

Unified Diff: LayoutTests/http/tests/credentialmanager/federatedcredential-basics.html

Issue 464783003: Credential manager: Convert strings to URLs early. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
Index: LayoutTests/http/tests/credentialmanager/federatedcredential-basics.html
diff --git a/LayoutTests/http/tests/credentialmanager/federatedcredential-basics.html b/LayoutTests/http/tests/credentialmanager/federatedcredential-basics.html
index 1814a4622266079cd62f195374a2d2345494332d..f3470cb93002407bc05d4498adf6a9e0e858f55d 100644
--- a/LayoutTests/http/tests/credentialmanager/federatedcredential-basics.html
+++ b/LayoutTests/http/tests/credentialmanager/federatedcredential-basics.html
@@ -22,4 +22,22 @@ test(function() {
assert_equals(credential.avatarURL, 'https://example.com/avatar.png');
assert_equals(credential.federation, 'https://federation.net/');
}, 'Interfaces and attributes of FederatedCredential');
+
+test(function() {
+ try {
+ var credential = new FederatedCredential('id', 'name', '-', 'https://federation.net/');
philipj_slow 2014/08/12 09:42:40 It looks like assert_throws would simplify this to
+ assert_unreached("Creating a credential with an invalid URL should throw a SyntaxError.");
+ } catch (e) {
+ assert_equals(e.name, "SyntaxError");
+ }
+}, 'Invalid avatar URL throws.');
philipj_slow 2014/08/12 09:42:40 In web-platform-tests I've been advised to not put
+
+test(function() {
+ try {
+ var credential = new FederatedCredential('id', 'name', 'https://example.com/avatar.png', '-');
+ assert_unreached("Creating a credential with an invalid URL should throw a SyntaxError.");
+ } catch (e) {
+ assert_equals(e.name, "SyntaxError");
+ }
+}, 'Invalid federation URL throws.');
</script>

Powered by Google App Engine
This is Rietveld 408576698