Chromium Code Reviews| 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> |