mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
2c53a5dcd9
# ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D35919 --HG-- extra : source : afa5bd771feba466ba7670c58f3d93233a14e202
20 lines
413 B
JavaScript
20 lines
413 B
JavaScript
"use strict";
|
|
|
|
add_task(function test_extractScheme() {
|
|
equal(Services.io.extractScheme("HtTp://example.com"), "http");
|
|
Assert.throws(
|
|
() => {
|
|
Services.io.extractScheme("://example.com");
|
|
},
|
|
/NS_ERROR_MALFORMED_URI/,
|
|
"missing scheme"
|
|
);
|
|
Assert.throws(
|
|
() => {
|
|
Services.io.extractScheme("ht%tp://example.com");
|
|
},
|
|
/NS_ERROR_MALFORMED_URI/,
|
|
"bad scheme"
|
|
);
|
|
});
|