mirror of
https://github.com/servo/servo.git
synced 2025-08-23 06:15:35 +01:00
Update web-platform-tests to revision ac4274136e9a034628a3a469890c8e37babbc902
This commit is contained in:
parent
c9229f3f99
commit
b0862d9cc1
68 changed files with 2064 additions and 135 deletions
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:import href="xslt-pass.xsl"/>
|
||||
</xsl:stylesheet>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet type="text/xsl" href="resources/request-url-path/import-relative.xsl"?>
|
||||
<stylesheet-test>
|
||||
This tests a stylesheet which has a xsl:import with a relative URL.
|
||||
</stylesheet-test>
|
|
@ -0,0 +1,12 @@
|
|||
self.addEventListener('fetch', event => {
|
||||
const url = new URL(event.request.url);
|
||||
|
||||
// For the import-relative.xsl file, respond in a way that changes the
|
||||
// response URL. This is expected to change the base URL and allow the import
|
||||
// from the file to succeed.
|
||||
const path = 'request-url-path/import-relative.xsl';
|
||||
if (url.pathname.indexOf(path) != -1) {
|
||||
// Respond with a different URL, deleting "request-url-path/".
|
||||
event.respondWith(fetch('import-relative.xsl'));
|
||||
}
|
||||
});
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<body>
|
||||
<p>PASS</p>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Service Worker: XSL's base URL must be the response URL</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/test-helpers.sub.js?pipe=sub"></script>
|
||||
<script>
|
||||
// This test loads an XML document which is controlled a service worker. The
|
||||
// document loads a stylesheet and a service worker responds with another URL.
|
||||
// The stylesheet imports a relative URL to test that the base URL is the
|
||||
// response URL from the service worker.
|
||||
promise_test(async (t) => {
|
||||
const SCOPE = 'resources/xsl-base-url-iframe.xml';
|
||||
const SCRIPT = 'resources/xsl-base-url-worker.js';
|
||||
let worker;
|
||||
let frame;
|
||||
|
||||
t.add_cleanup(() => {
|
||||
if (frame)
|
||||
frame.remove();
|
||||
service_worker_unregister(t, SCOPE);
|
||||
});
|
||||
|
||||
const registration = await service_worker_unregister_and_register(
|
||||
t, SCRIPT, SCOPE);
|
||||
worker = registration.installing;
|
||||
await wait_for_state(t, worker, 'activated');
|
||||
|
||||
frame = await with_iframe(SCOPE);
|
||||
assert_equals(frame.contentDocument.body.textContent, 'PASS');
|
||||
}, 'base URL when service worker does respondWith(fetch(responseUrl))');
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue