Ensure that the API base URL is used in Fetch APIs.

This commit is contained in:
Ms2ger 2016-12-19 19:33:07 +01:00
parent 26cf0a7a8c
commit fbed4d23d6
6 changed files with 14 additions and 2 deletions

View file

@ -0,0 +1,5 @@
[url-parsing.html]
type: testharness
[should parse the URL relative to the current settings object]
expected: FAIL

View file

@ -0,0 +1,5 @@
[url-parsing.html]
type: testharness
[should parse the redirect Location URL relative to the current settings object]
expected: FAIL

View file

@ -1,2 +1,3 @@
<!DOCTYPE html> <!DOCTYPE html>
<title>Current page used as a test helper</title> <title>Current page used as a test helper</title>
<base href="success/">

View file

@ -20,7 +20,7 @@ promise_test(() => {
return loadPromise.then(() => { return loadPromise.then(() => {
const req = document.querySelector('iframe').contentWindow.createRequest("url"); const req = document.querySelector('iframe').contentWindow.createRequest("url");
assert_equals(req.url, new URL("current/url", location.href).href); assert_equals(req.url, new URL("current/success/url", location.href).href);
}); });
}, "should parse the URL relative to the current settings object"); }, "should parse the URL relative to the current settings object");

View file

@ -1,2 +1,3 @@
<!DOCTYPE html> <!DOCTYPE html>
<title>Current page used as a test helper</title> <title>Current page used as a test helper</title>
<base href="success/">

View file

@ -20,7 +20,7 @@ promise_test(() => {
return loadPromise.then(() => { return loadPromise.then(() => {
const res = document.querySelector('iframe').contentWindow.createRedirectResponse("url"); const res = document.querySelector('iframe').contentWindow.createRedirectResponse("url");
assert_equals(res.headers.get("Location"), new URL("current/url", location.href).href); assert_equals(res.headers.get("Location"), new URL("current/success/url", location.href).href);
}); });
}, "should parse the redirect Location URL relative to the current settings object"); }, "should parse the redirect Location URL relative to the current settings object");