mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Make the multi-global tests more robust.
This commit is contained in:
parent
d918c14247
commit
26cf0a7a8c
6 changed files with 5 additions and 17 deletions
|
@ -1,5 +0,0 @@
|
||||||
[url-parsing.html]
|
|
||||||
type: testharness
|
|
||||||
[should parse the URL relative to the current settings object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[url-parsing.html]
|
|
||||||
type: testharness
|
|
||||||
[should parse the redirect Location URL relative to the current settings object]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -6,9 +6,8 @@
|
||||||
<script>
|
<script>
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const current = document.querySelector('#c').contentWindow;
|
|
||||||
|
|
||||||
window.createRequest = (...args) => {
|
window.createRequest = (...args) => {
|
||||||
|
const current = document.querySelector('#c').contentWindow;
|
||||||
return new current.Request(...args);
|
return new current.Request(...args);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ const loadPromise = new Promise(resolve => {
|
||||||
|
|
||||||
promise_test(() => {
|
promise_test(() => {
|
||||||
return loadPromise.then(() => {
|
return loadPromise.then(() => {
|
||||||
const req = frames[0].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/url", location.href).href);
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,10 +7,9 @@
|
||||||
<script>
|
<script>
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const current = document.querySelector('#c').contentWindow;
|
|
||||||
const relevant = document.querySelector('#r').contentWindow;
|
|
||||||
|
|
||||||
window.createRedirectResponse = (...args) => {
|
window.createRedirectResponse = (...args) => {
|
||||||
|
const current = document.querySelector('#c').contentWindow;
|
||||||
|
const relevant = document.querySelector('#r').contentWindow;
|
||||||
return current.Response.redirect.call(relevant.Response, ...args);
|
return current.Response.redirect.call(relevant.Response, ...args);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ const loadPromise = new Promise(resolve => {
|
||||||
|
|
||||||
promise_test(() => {
|
promise_test(() => {
|
||||||
return loadPromise.then(() => {
|
return loadPromise.then(() => {
|
||||||
const res = frames[0].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/url", location.href).href);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue