Index: LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered.html |
diff --git a/LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered.html b/LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered.html |
index 6e2e53d44e81cf4441b0c185e17a2a0a55b74fff..dab41fb86d021d898ebae7ad6fe3a3c5f40bdc9f 100644 |
--- a/LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered.html |
+++ b/LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered.html |
@@ -28,6 +28,21 @@ if (succeeded) |
else |
debug('FAIL Invalid url "' + invalidUrl + '" allowed.'); |
+var invalid_schemes = ['mailto:', 'ssh:/', 'magnet:+', 'tel:sip']; |
+invalid_schemes.forEach(function (scheme) { |
+ var succeeded = false; |
+ try { |
+ window.navigator.registerProtocolHandler(scheme, 'invalid scheme uri=%s', 'title'); |
+ } catch (e) { |
+ succeeded = true; |
+ } |
+ |
+ if (succeeded) |
+ debug('PASS Invalid scheme "' + scheme + '" falied.'); |
+ else |
+ debug('FAIL Invalid scheme "' + scheme + '" allowed.'); |
+}); |
+ |
// FIXME: Need to check if this function can return 'registered' and 'declined' states as well. |
try { |
var state = window.navigator.isProtocolHandlerRegistered("bitcoin", "valid protocol %s"); |