Index: LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler.html |
diff --git a/LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler.html b/LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler.html |
index d79ac9650f236908719f12af7959101db58e5f8f..731beb73973b2ff5c73bc1c93aec1493e2cf7229 100644 |
--- a/LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler.html |
+++ b/LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler.html |
@@ -50,10 +50,25 @@ valid_protocols.forEach(function (protocol) { |
debug('Fail: Valid protocol "' + protocol + '" failed.'); |
}); |
+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.'); |
+}); |
+ |
var invalid_urls = ["", "%S"]; |
invalid_urls.forEach(function (url) { |
- var succeeded = false; |
- try { |
+ var succeeded = false; |
+ try { |
window.navigator.registerProtocolHandler('web+myprotocol', url, 'title'); |
} catch (e) { |
succeeded = 'SyntaxError' == e.name; |