gecko-dev/netwerk/test/unit/test_ioservice.js
Victor Porof 2c53a5dcd9 Bug 1561435 - Format netwerk/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35919

--HG--
extra : source : afa5bd771feba466ba7670c58f3d93233a14e202
2019-07-05 10:55:23 +02:00

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"
);
});