summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fetch/api/basic/response-url.js
blob: 91b553aaef0987df09cbde3dab7508fa53366390 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
if (this.document === undefined) {
  importScripts("/resources/testharness.js");
}

function checkResponseURL(fetchedURL, expectedURL)
{
    promise_test(function() {
        return fetch(fetchedURL).then(function(response) {
            assert_equals(response.url, expectedURL);
        });
    }, "Testing response url getter with " +fetchedURL);
}

var baseURL = "http://{{host}}:{{ports[http][0]}}";
checkResponseURL(baseURL + "/ada", baseURL + "/ada");
checkResponseURL(baseURL + "/#", baseURL + "/");
checkResponseURL(baseURL + "/#ada", baseURL + "/");
checkResponseURL(baseURL + "#ada", baseURL + "/");

done();