blob: d218d77a7a949b925c22669c243a3da1ee131ef8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
"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"
);
});
|