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

Unified Diff: LayoutTests/fast/dom/unregister-protocol-handler.html

Issue 144313006: Move test cases of the navigator content utils to own directory (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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
Index: LayoutTests/fast/dom/unregister-protocol-handler.html
diff --git a/LayoutTests/fast/dom/unregister-protocol-handler.html b/LayoutTests/fast/dom/unregister-protocol-handler.html
deleted file mode 100644
index 301cf59fca7b3ceee19279be6d07351f3b5ad745..0000000000000000000000000000000000000000
--- a/LayoutTests/fast/dom/unregister-protocol-handler.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<html>
-<body>
-<p>This test makes sure that navigator.unregisterProtocolHandler throws the proper exceptions and has no-op default implementation.</p>
-<pre id="console"></pre>
-<script>
-if (window.testRunner)
- testRunner.dumpAsText();
-
-function debug(str)
-{
- var c = document.getElementById('console')
- c.appendChild(document.createTextNode(str + '\n'));
-}
-
-if (window.navigator.unregisterProtocolHandler)
- debug('Pass: window.navigator.unregisterProtocolHandler is defined.');
-else
- debug('Fail: window.navigator.unregisterProtocolHandler is not defined.');
-
-var invalid_protocols = ['http', 'https', 'file', 'web+'];
-invalid_protocols.forEach(function (protocol) {
- var succeeded = false;
- try {
- window.navigator.unregisterProtocolHandler(protocol, "invalid protocol %s", "title");
- } catch (e) {
- succeeded = 'SecurityError' == e.name;
- errorMessage = e.message;
- }
-
- if (succeeded)
- debug('Pass: Invalid protocol "' + protocol + '" threw SecurityError exception: "' + errorMessage + '".');
- else
- debug('Fail: Invalid protocol "' + protocol + '" allowed.');
-});
-
-var valid_protocols = ['bitcoin', 'geo', 'im', 'irc', 'ircs', 'magnet', 'mailto', 'mms', 'news', 'nntp', 'sip', 'sms', 'smsto', 'ssh', 'tel', 'urn', 'webcal', 'wtai', 'xmpp'];
-valid_protocols.forEach(function (protocol) {
- var succeeded = false;
- try {
- window.navigator.unregisterProtocolHandler(protocol, "valid protocol %s", "title");
- succeeded = true;
- } catch (e) {
- succeeded = false;
- }
-
- if (succeeded)
- debug('Pass: Valid protocol "' + protocol + '" allowed.');
- else
- debug('Fail: Valid protocol "' + protocol + '" failed.');
-});
-
-var invalid_urls = ["", "%S"];
-invalid_urls.forEach(function (url) {
- var succeeded = false;
- try {
- window.navigator.unregisterProtocolHandler('web+myprotocol', url, 'title');
- } catch (e) {
- succeeded = 'SyntaxError' == e.name;
- errorMessage = e.message;
- }
-
- if (succeeded)
- debug('Pass: Invalid url "' + url + '" threw SyntaxError exception.' + errorMessage + '".');
- else
- debug('Fail: Invalid url "' + url + '" allowed.');
-});
-
-// Test that the API has default no-op implementation.
-var succeeded = true;
-try {
- window.navigator.unregisterProtocolHandler('web+myprotocol', "%s", "title");
-} catch (e) {
- succeeded = false;
-}
-
-if (succeeded)
- debug('Pass: Valid call succeeded.');
-else
- debug('Fail: Invalid call did not succeed.');
-</script>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698