mirror of
https://github.com/servo/servo.git
synced 2025-09-01 18:48:23 +01:00
Update web-platform-tests to revision 36634cbcf3253dfe8d220990a27ad4eeebf8ec2f
This commit is contained in:
parent
0964d055cd
commit
7295abcc2a
245 changed files with 5966 additions and 1901 deletions
|
@ -92,10 +92,6 @@ function redirect_test(url,
|
|||
expected_request_infos,
|
||||
test_name) {
|
||||
promise_test(async t => {
|
||||
const message_promise = new Promise(resolve => {
|
||||
// A message with ID 'last_url' will be sent from the iframe.
|
||||
message_resolvers['last_url'] = resolve;
|
||||
});
|
||||
const frame = await with_iframe(url);
|
||||
t.add_cleanup(() => { frame.remove(); });
|
||||
|
||||
|
@ -105,7 +101,7 @@ function redirect_test(url,
|
|||
});
|
||||
});
|
||||
await check_all_intercepted_urls(expected_intercepted_urls);
|
||||
const last_url = await message_promise;
|
||||
const last_url = await send_to_iframe(frame, 'getLocation');
|
||||
assert_equals(last_url, expected_last_url, 'Last URL should match.');
|
||||
}, test_name);
|
||||
}
|
||||
|
@ -129,7 +125,7 @@ function send_to_iframe(frame, message) {
|
|||
message_resolvers[message_id] = resolve;
|
||||
frame.contentWindow.postMessage(
|
||||
{id: message_id, message},
|
||||
host_info['HTTPS_REMOTE_ORIGIN']);
|
||||
'*');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -11,10 +11,12 @@ def main(request, response):
|
|||
return status, [("content-type", "text/html")], '''
|
||||
<!DOCTYPE html>
|
||||
<script>
|
||||
onmessage = event => {
|
||||
window.parent.postMessage(
|
||||
{
|
||||
id: 'last_url',
|
||||
id: event.data.id,
|
||||
result: location.href
|
||||
}, '*');
|
||||
};
|
||||
</script>
|
||||
'''
|
||||
|
|
|
@ -11,10 +11,12 @@ def main(request, response):
|
|||
return status, [("content-type", "text/html")], '''
|
||||
<!DOCTYPE html>
|
||||
<script>
|
||||
onmessage = event => {
|
||||
window.parent.postMessage(
|
||||
{
|
||||
id: 'last_url',
|
||||
id: event.data.id,
|
||||
result: location.href
|
||||
}, '*');
|
||||
};
|
||||
</script>
|
||||
'''
|
||||
|
|
|
@ -11,10 +11,12 @@ def main(request, response):
|
|||
return status, [("content-type", "text/html")], '''
|
||||
<!DOCTYPE html>
|
||||
<script>
|
||||
onmessage = event => {
|
||||
window.parent.postMessage(
|
||||
{
|
||||
id: 'last_url',
|
||||
id: event.data.id,
|
||||
result: location.href
|
||||
}, '*');
|
||||
};
|
||||
</script>
|
||||
'''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue