function done()
{
    finishSWTest();
}

var registrations = [
    ["image-mime-type.py", {}],
    ["", {}],
    ["http://127.0.0.1:abc", {}],
    ["somescheme://script.js", { }],
    ["resources/%2fscript.js", { }],
    ["resources/script.js", { scope: "somescheme://script.js" }],
    ["resources/script.js", { scope: "%2fscript.js" }],
    ["http://localhost:8000/workers/service/resources/empty-worker.js", { }],
    ["resources/empty-worker.js", { scope: "http://localhost:8000/workers/service/" }]
];

async function doTest()
{
    for (let registration of registrations) {
        await navigator.serviceWorker.register(registration[0], registration[1]).then(function(r) {
            console.log("Registered! (unexpectedly)");
        }, function(e) {
            console.log("Registration failed with error: " + e);
        }).catch(function(e) {
            console.log("Exception registering: " + e);i
        });
    }
    finishSWTest();
}

doTest();
