| Index: LayoutTests/navigatorcontentutils/is-protocol-handler-registered.html
|
| diff --git a/LayoutTests/navigatorcontentutils/is-protocol-handler-registered.html b/LayoutTests/navigatorcontentutils/is-protocol-handler-registered.html
|
| index c015588eb72d2f1d91f65860245c6d39fdb8fd1f..244265ce7430216d36d78a10363cca3ff655dcac 100644
|
| --- a/LayoutTests/navigatorcontentutils/is-protocol-handler-registered.html
|
| +++ b/LayoutTests/navigatorcontentutils/is-protocol-handler-registered.html
|
| @@ -7,8 +7,10 @@
|
| <p>This test makes sure that navigator.isProtocolHandlerRegistered throws the proper exceptions and returns the default state of handler.</p>
|
| <pre id="console"></pre>
|
| <script>
|
| -if (window.testRunner)
|
| +if (window.testRunner) {
|
| + testRunner.setAllowUniversalAccessFromFileURLs(false);
|
| testRunner.dumpAsText();
|
| +}
|
|
|
| if (window.internals)
|
| internals.setNavigatorContentUtilsClientMock(document);
|
| @@ -47,6 +49,21 @@ invalid_schemes.forEach(function (scheme) {
|
| debug('FAIL Invalid scheme "' + scheme + '" allowed. Threw exception: "' + errorMessage + '".');
|
| });
|
|
|
| +// Test that the API throws SecurityError exception if the URL's origin differs from the document's origin.
|
| +succeeded = false;
|
| +var errorMessage;
|
| +try {
|
| + window.navigator.isProtocolHandlerRegistered('web+myprotocol', "http://www.example.com/soup?url=%s");
|
| +} catch (e) {
|
| + succeeded = true;
|
| + errorMessage = e.message;
|
| +}
|
| +
|
| +if (succeeded)
|
| + debug('PASS Invalid url threw SecurityError exception: "' + errorMessage + '".');
|
| +else
|
| + debug('FAIL URL with origin different than document origin is allowed.');
|
| +
|
| debug("\nCheck if isProtocolHandlerRegistered() works correctly. If isProtocolHandlerRegistered() returns 'new' state, it works well.");
|
| debug("'bitcoin' protocol will be registered, and then checks if the 'bitcoin' protocol is registered by isProtocolHandlerRegistered().\n");
|
| try {
|
|
|