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

Unified Diff: LayoutTests/navigatorcontentutils/register-protocol-handler.html

Issue 440833006: Use a consistent scheme name in navigatorcontentutils tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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/navigatorcontentutils/register-protocol-handler.html
diff --git a/LayoutTests/navigatorcontentutils/register-protocol-handler.html b/LayoutTests/navigatorcontentutils/register-protocol-handler.html
index 5501432fa49436f100272390e8ab95ad2cd87286..9b68afa0fdc5c7e512b728c7fb2e237e74444275 100644
--- a/LayoutTests/navigatorcontentutils/register-protocol-handler.html
+++ b/LayoutTests/navigatorcontentutils/register-protocol-handler.html
@@ -17,37 +17,37 @@ if (window.navigator.registerProtocolHandler)
else
debug('FAIL window.navigator.registerProtocolHandler is not defined.');
-var invalid_protocols = ['http', 'https', 'file', 'web+'];
-invalid_protocols.forEach(function (protocol) {
+var invalid_schemes = ['http', 'https', 'file', 'web+'];
+invalid_schemes.forEach(function (scheme) {
var succeeded = false;
var errorMessage;
try {
- window.navigator.registerProtocolHandler(protocol, "invalid protocol %s", "title");
+ window.navigator.registerProtocolHandler(scheme, "invalid scheme %s", "title");
} catch (e) {
succeeded = 'SecurityError' == e.name;
errorMessage = e.message;
}
if (succeeded) {
- debug('PASS Invalid protocol "' + protocol + '" threw SecurityError exception: "' + errorMessage + '".');
+ debug('PASS Invalid scheme "' + scheme + '" threw SecurityError exception: "' + errorMessage + '".');
}else
- debug('FAIL Invalid protocol "' + protocol + '" allowed.');
+ debug('FAIL Invalid scheme "' + scheme + '" allowed.');
});
-var valid_protocols = ['bitcoin', 'BitcoIn', 'geo', 'im', 'irc', 'Irc', 'ircs', 'magnet', 'MagneT', 'mailto', 'mms', 'news', 'nntp', 'sip', 'sms', 'smsto', 'SmsTo', 'ssh', 'tel', 'urn', 'webcal', 'WebCAL', 'wtai', 'WTAI', 'xmpp'];
-valid_protocols.forEach(function (protocol) {
+var valid_schemes = ['bitcoin', 'BitcoIn', 'geo', 'im', 'irc', 'Irc', 'ircs', 'magnet', 'MagneT', 'mailto', 'mms', 'news', 'nntp', 'sip', 'sms', 'smsto', 'SmsTo', 'ssh', 'tel', 'urn', 'webcal', 'WebCAL', 'wtai', 'WTAI', 'xmpp'];
+valid_schemes.forEach(function (scheme) {
var succeeded = false;
try {
- window.navigator.registerProtocolHandler(protocol, "valid protocol %s", "title");
+ window.navigator.registerProtocolHandler(scheme, "valid scheme %s", "title");
succeeded = true;
} catch (e) {
succeeded = false;
}
if (succeeded)
- debug('PASS Valid protocol "' + protocol + '" allowed.');
+ debug('PASS Valid scheme "' + scheme + '" allowed.');
else
- debug('FAIL Valid protocol "' + protocol + '" failed.');
+ debug('FAIL Valid scheme "' + scheme + '" failed.');
});
var invalid_schemes = ['mailto:', 'ssh:/', 'magnet:+', 'tel:sip'];
@@ -70,7 +70,7 @@ var invalid_urls = ["", "%S"];
invalid_urls.forEach(function (url) {
var succeeded = false;
try {
- window.navigator.registerProtocolHandler('web+myprotocol', url, 'title');
+ window.navigator.registerProtocolHandler('web+myscheme', url, 'title');
} catch (e) {
succeeded = 'SyntaxError' == e.name;
errorMessage = e.message;
@@ -85,7 +85,7 @@ invalid_urls.forEach(function (url) {
// Test that the API has default no-op implementation.
var succeeded = true;
try {
- window.navigator.registerProtocolHandler('web+myprotocol', "%s", "title");
+ window.navigator.registerProtocolHandler('web+myscheme', "%s", "title");
} catch (e) {
succeeded = false;
}
@@ -95,20 +95,20 @@ if (succeeded)
else
debug('FAIL Invalid call did not succeed.');
-// Check if registerProtocolHandler can register protocol.
-debug("\nCheck if registerProtocolHandler can register protocol correctly. If isProtocolHandlerRegistered() returns 'registered' state, registerProtoclHandler() works well.");
-debug("'bitcoin' protocol will be registered for testing.\n");
+// Check if registerProtocolHandler can register custom scheme.
+debug("\nCheck if registerProtocolHandler can register scheme correctly. If isProtocolHandlerRegistered() returns 'registered' state, registerProtoclHandler() works well.");
+debug("'bitcoin' scheme will be registered for testing.\n");
try {
- // Register 'bitcoin' protocol for testing.
+ // Register 'bitcoin' scheme for testing.
window.navigator.registerProtocolHandler('bitcoin', 'invalid scheme uri=%s', 'title');
- var state = window.navigator.isProtocolHandlerRegistered('bitcoin', 'valid protocol %s');
+ var state = window.navigator.isProtocolHandlerRegistered('bitcoin', 'valid scheme %s');
if (state == "registered")
debug("PASS window.navigator.isProtocolHandlerRegistered returns 'registered' state. 'bitcoin' is registered successfully.");
else if (state == "new")
- debug("FAIL window.navigator.isProtocolHandlerRegistered returns 'new' state. Fail to register 'bitcoin' protocol.");
+ debug("FAIL window.navigator.isProtocolHandlerRegistered returns 'new' state. Fail to register 'bitcoin' scheme.");
else if (state == "declined")
- debug("FAIL window.navigator.isProtocolHandlerRegistered returns 'declined' state. Fail to register 'bitcoin' protocol");
+ debug("FAIL window.navigator.isProtocolHandlerRegistered returns 'declined' state. Fail to register 'bitcoin' scheme");
} catch (e) {
debug('FAIL window.navigator.isProtocolHandlerRegistered call is failed: "' + e.message + '".');
}

Powered by Google App Engine
This is Rietveld 408576698