| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="/js-test-resources/js-test.js"></script> | 3 <script src="/js-test-resources/js-test.js"></script> |
| 4 </head> | 4 </head> |
| 5 <body> | 5 <body> |
| 6 <p>This test makes sure that navigator.registerProtocolHandler throws the proper
exceptions and has no-op default implementation.</p> | 6 <p>This test makes sure that navigator.registerProtocolHandler throws the proper
exceptions and has no-op default implementation.</p> |
| 7 <pre id="console"></pre> | 7 <pre id="console"></pre> |
| 8 <script> | 8 <script> |
| 9 if (window.internals) | 9 if (window.internals) |
| 10 internals.setNavigatorContentUtilsClientMock(document); | 10 internals.setNavigatorContentUtilsClientMock(document); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 succeeded = 'SecurityError' == e.name; | 24 succeeded = 'SecurityError' == e.name; |
| 25 errorMessage = e.message; | 25 errorMessage = e.message; |
| 26 } | 26 } |
| 27 | 27 |
| 28 if (succeeded) { | 28 if (succeeded) { |
| 29 debug('PASS Invalid scheme "' + scheme + '" threw SecurityError exceptio
n: "' + errorMessage + '".'); | 29 debug('PASS Invalid scheme "' + scheme + '" threw SecurityError exceptio
n: "' + errorMessage + '".'); |
| 30 }else | 30 }else |
| 31 debug('FAIL Invalid scheme "' + scheme + '" allowed.'); | 31 debug('FAIL Invalid scheme "' + scheme + '" allowed.'); |
| 32 }); | 32 }); |
| 33 | 33 |
| 34 var valid_schemes = ['bitcoin', 'BitcoIn', 'geo', 'im', 'irc', 'Irc', 'ircs', 'm
agnet', 'MagneT', 'mailto', 'mms', 'news', 'nntp', 'openpgp4fpr', 'sip', 'sms',
'smsto', 'SmsTo', 'ssh', 'tel', 'urn', 'webcal', 'WebCAL', 'wtai', 'WTAI', 'xmpp
']; | 34 var valid_schemes = ['bitcoin', 'BitcoIn', 'geo', 'git', 'git+http', 'git+https'
, 'git+ssh', 'im', 'irc', 'Irc', 'ircs', 'magnet', 'MagneT', 'mailto', 'mms', 'n
ews', 'nntp', 'openpgp4fpr', 'sip', 'sms', 'smsto', 'SmsTo', 'ssh', 'tel', 'urn'
, 'webcal', 'WebCAL', 'wtai', 'WTAI', 'xmpp']; |
| 35 valid_schemes.forEach(function (scheme) { | 35 valid_schemes.forEach(function (scheme) { |
| 36 var succeeded = false; | 36 var succeeded = false; |
| 37 try { | 37 try { |
| 38 window.navigator.registerProtocolHandler(scheme, "valid scheme %s", "tit
le"); | 38 window.navigator.registerProtocolHandler(scheme, "valid scheme %s", "tit
le"); |
| 39 succeeded = true; | 39 succeeded = true; |
| 40 } catch (e) { | 40 } catch (e) { |
| 41 succeeded = false; | 41 succeeded = false; |
| 42 } | 42 } |
| 43 | 43 |
| 44 if (succeeded) | 44 if (succeeded) |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 else if (state == "declined") | 122 else if (state == "declined") |
| 123 debug("FAIL window.navigator.isProtocolHandlerRegistered returns 'declin
ed' state. Fail to register 'bitcoin' scheme"); | 123 debug("FAIL window.navigator.isProtocolHandlerRegistered returns 'declin
ed' state. Fail to register 'bitcoin' scheme"); |
| 124 } catch (e) { | 124 } catch (e) { |
| 125 debug('FAIL window.navigator.isProtocolHandlerRegistered call is failed: "'
+ e.message + '".'); | 125 debug('FAIL window.navigator.isProtocolHandlerRegistered call is failed: "'
+ e.message + '".'); |
| 126 } | 126 } |
| 127 debug("\n"); | 127 debug("\n"); |
| 128 | 128 |
| 129 </script> | 129 </script> |
| 130 </body> | 130 </body> |
| 131 </html> | 131 </html> |
| OLD | NEW |