Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(745)

Unified Diff: LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered.html

Issue 335783003: Move navigatorcontentutils directory to top of LayoutTests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix wrong include path in tests Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
deleted file mode 100644
index 4138d770bbd6f7e4c5291f68e844b353808926f8..0000000000000000000000000000000000000000
--- a/LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../../resources/js-test.js"></script>
-</head>
-<body>
-<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)
- testRunner.dumpAsText();
-
-if (window.internals)
- internals.setNavigatorContentUtilsClientMock(document);
-
-if (window.navigator.isProtocolHandlerRegistered)
- debug('PASS window.navigator.isProtocolHandlerRegistered is defined.');
-else
- debug('FAIL window.navigator.isProtocolHandlerRegistered is not defined.');
-
-var invalidUrl = "%S";
-var succeeded = false;
-try {
- window.navigator.isProtocolHandlerRegistered(protocol, invalidUrl);
- succeeded = false;
-} catch (e) {
- succeeded = true;
-}
-if (succeeded)
- debug('PASS Invalid url "' + invalidUrl + '" threw SyntaxError exception.');
-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.isProtocolHandlerRegistered(scheme, 'invalid scheme uri=%s');
- } catch (e) {
- succeeded = 'SyntaxError' == e.name;
- errorMessage = e.message;
- }
-
- if (succeeded)
- debug('PASS Invalid scheme "' + scheme + '" falied.');
- else
- debug('FAIL Invalid scheme "' + scheme + '" allowed. Threw exception: "' + errorMessage + '".');
-});
-
-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 {
- // Register 'bitcoin' protocol for testing.
- window.navigator.registerProtocolHandler('bitcoin', 'invalid scheme uri=%s', 'title');
-
- var state = window.navigator.isProtocolHandlerRegistered("bitcoin", "valid protocol %s");
- if (state == "registered")
- debug("PASS window.navigator.isProtocolHandlerRegistered returns 'registered' state. isProtocolHandlerRegistered() works correctly.");
- else if (state == "new")
- debug("FAIL window.navigator.isProtocolHandlerRegistered returns 'new' state.");
- else if (state == "declined")
- debug("FAIL window.navigator.isProtocolHandlerRegistered returns 'declined' state.");
-} catch (e) {
- debug('FAIL window.navigator.isProtocolHandlerRegistered call is failed: "' + e.message + '".');
-}
-debug("\n");
-
-</script>
-</body>
-</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698