Update web-platform-tests and CSS tests.

- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180.
- Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
This commit is contained in:
Ms2ger 2017-02-06 11:06:12 +01:00
parent fb4f421c8b
commit 296fa2512b
21852 changed files with 2080936 additions and 892894 deletions

View file

@ -0,0 +1,33 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../service-workers/service-worker/resources/test-helpers.sub.js"></script>
<script>
async_test(function(t) {
var worker_url = 'resources/fetch-destination-worker.js';
var scope = 'resources/empty.html';
var registration;
service_worker_unregister_and_register(t, worker_url, scope)
.then(t.step_func(function(r) {
registration = r;
return wait_for_state(t, r.installing, 'activated');
}))
.then(t.step_func(function() {
return with_iframe(scope);
}))
.then(t.step_func(function(frame) {
var link = frame.contentWindow.document.createElement("link");
link.as = "fetch";
link.href = "resources/dummy.xml";
link.rel = "preload";
link.addEventListener("load", t.step_func_done(function() { registration.unregister(); }));
link.addEventListener("error", t.step_func_done(function() {
registration.unregister();
assert_unreached("Fetch destination preload errored");
}));
frame.contentWindow.document.body.appendChild(link);
}))
.catch(unreached_rejection(t));
}, 'Fetch destination preload');
</script>

View file

@ -0,0 +1,9 @@
self.addEventListener('fetch', function(event) {
if (event.request.url.indexOf('dummy.xml') != -1) {
if (!event.request.destination || event.request.destination == "")
event.respondWith(new Response());
else
event.respondWith(Response.error());
}
});

View file

@ -1,19 +1,20 @@
<!DOCTYPE html>
<title>Ensure preloaded resources are not downloaded again when used</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel=preload href="resources/square.png?pipe=trickle(d1)" as=image>
<script>
var t = async_test('Makes sure that preloaded resources are not downloaded again when used');
</script>
<div id=result></div>
<link rel=preload href="resources/square.png" as=image>
<script>
window.addEventListener("load", t.step_func(function() {
t.step_timeout(function() {
document.getElementById("result").innerHTML = "<image src='resources/square.png'>";
t.step_timeout(function() {
assert_equals(performance.getEntriesByType("resource").length, 3);
t.done();
}, 1000);
}, 1000);
}));
var link = document.getElementsByTagName("link")[0]
assert_equals(link.as, "image");
link.addEventListener("load", () => {
assert_equals(performance.getEntriesByType("resource").length, 3)
var img = document.createElement("img");
img.src = "resources/square.png?pipe=trickle(d1)";
img.onload = () => {
assert_equals(performance.getEntriesByType("resource").length, 3);
done();
};
document.body.appendChild(img);
});
</script>
<body>