Update web-platform-tests to revision 1abcb7058ecdaabd5fe9c27c90a73795d31d2a0a

This commit is contained in:
WPT Sync Bot 2018-12-03 20:36:55 -05:00
parent 5bdea7dc1c
commit c930649cd6
53 changed files with 413 additions and 851 deletions

View file

@ -61,7 +61,7 @@ tasks:
owner: ${event.pusher.email}
source: ${event.repository.url}
payload:
image: hexcles/web-platform-tests:0.23
image: harjgam/web-platform-tests:0.25
maxRunTime: 7200
artifacts:
public/results:

View file

@ -321,6 +321,6 @@ backgroundFetchTest(async (test, backgroundFetch) => {
assert_true(results[1].url.includes('resources/feature-name.txt'));
assert_equals(results[1].status, 200);
assert_equals(results[1].text, 'error');
assert_equals(results[1].text, 'Background Fetch');
}, 'Matching multiple times on the same request works as expected.');

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-multicol/#filling-columns">
<div id="multicol" style="columns:2; line-height:100px;">
<div style="display:table-row; height:4.9999px;"></div>
<div style="display:table-row;">
<br>
</div>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=> {
assert_equals(multicol.getBoundingClientRect().height, 100);
}, "If we have room for the line, we have room for all we need");
</script>

View file

@ -4,30 +4,30 @@
// Source: DOM Parsing and Serialization (https://w3c.github.io/DOM-Parsing/)
[Constructor, Exposed=Window]
interface DOMParser {
[NewObject] Document parseFromString(DOMString str, SupportedType type);
};
interface DOMParser {
[NewObject] Document parseFromString(DOMString str, SupportedType type);
};
enum SupportedType {
"text/html",
"text/xml",
"application/xml",
"application/xhtml+xml",
"image/svg+xml"
};
enum SupportedType {
"text/html",
"text/xml",
"application/xml",
"application/xhtml+xml",
"image/svg+xml"
};
[Constructor, Exposed=Window]
interface XMLSerializer {
DOMString serializeToString(Node root);
};
interface XMLSerializer {
DOMString serializeToString(Node root);
};
partial interface Element {
[CEReactions, TreatNullAs=EmptyString] attribute DOMString innerHTML;
[CEReactions, TreatNullAs=EmptyString] attribute DOMString outerHTML;
[CEReactions] void insertAdjacentHTML(DOMString position, DOMString text);
};
[CEReactions, TreatNullAs=EmptyString] attribute DOMString innerHTML;
[CEReactions, TreatNullAs=EmptyString] attribute DOMString outerHTML;
[CEReactions] void insertAdjacentHTML(DOMString position, DOMString text);
};
partial interface Range {
[CEReactions, NewObject] DocumentFragment createContextualFragment(DOMString fragment);
};
[CEReactions, NewObject] DocumentFragment createContextualFragment(DOMString fragment);
};

View file

@ -1,16 +1,14 @@
// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into reffy-reports
// (https://github.com/tidoust/reffy-reports)
// Source: Input Events Level 1 (https://rawgit.com/w3c/input-events/v1/index.html)
// Source: Input Events Level 1 (https://cdn.staticaly.com/gh/w3c/input-events/v1/index.html)
partial interface InputEvent {
readonly attribute DOMString inputType;
readonly attribute DataTransfer? dataTransfer;
sequence<StaticRange> getTargetRanges();
};
readonly attribute DataTransfer? dataTransfer;
sequence<StaticRange> getTargetRanges();
};
partial dictionary InputEventInit {
DOMString inputType = "";
DataTransfer? dataTransfer = null;
sequence<StaticRange> targetRanges = [];
};
partial dictionary InputEventInit {
DataTransfer? dataTransfer = null;
sequence<StaticRange> targetRanges = [];
};

View file

@ -12,7 +12,12 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, script, scope)
.then(function(r) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
registration = r;
return wait_for_state(t, registration.installing, 'activated');
})
.then(function() {
@ -28,7 +33,6 @@ promise_test(function(t) {
})
.then(function(result) {
assert_equals(result, 'OK');
return service_worker_unregister_and_done(t, scope);
});
}, 'Post loopback messages');
@ -41,6 +45,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, script1, scope)
.then(function(r) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
registration = r;
return wait_for_state(t, registration.installing, 'activated');
})
@ -69,7 +77,6 @@ promise_test(function(t) {
.then(function(result) {
assert_equals(result, 'OK');
frame.remove();
return service_worker_unregister_and_done(t, scope);
});
}, 'Post messages among service workers');

View file

@ -11,6 +11,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, script, scope)
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, registration.installing, 'redundant');
})
.then(function() {
@ -21,7 +25,6 @@ promise_test(function(t) {
result,
undefined,
'After unregister(), the registration should not found');
return service_worker_unregister_and_done(t, scope);
});
}, 'Unregister on script evaluation');
@ -31,6 +34,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, script, scope)
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, registration.installing, 'redundant');
})
.then(function() {
@ -41,7 +48,6 @@ promise_test(function(t) {
result,
undefined,
'After unregister(), the registration should not found');
return service_worker_unregister_and_done(t, scope);
});
}, 'Unregister on installing event');
@ -51,6 +57,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, script, scope)
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, registration.installing, 'redundant');
})
.then(function() {
@ -61,7 +71,6 @@ promise_test(function(t) {
result,
undefined,
'After unregister(), the registration should not found');
return service_worker_unregister_and_done(t, scope);
});
}, 'Unregister on activate event');
@ -74,6 +83,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, script, scope)
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, registration.installing, 'activated');
})
.then(function() { return with_iframe(scope); })
@ -120,7 +133,6 @@ promise_test(function(t) {
frame.remove();
new_frame.remove();
return service_worker_unregister_and_done(t, scope);
})
}, 'Unregister controlling service worker');

View file

@ -13,6 +13,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, script, scope)
.then(function(r) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
registration = r;
return wait_for_state(t, registration.installing, 'activated');
})
@ -38,7 +42,6 @@ promise_test(function(t) {
'events seen by the worker');
frame1.remove();
frame2.remove();
return service_worker_unregister_and_done(t, scope);
});
}, 'Update a registration on ServiceWorkerGlobalScope');

View file

@ -60,6 +60,9 @@ function getClientIdByURL(worker, url) {
async function doAsyncTest(t, scope) {
let reg = await service_worker_unregister_and_register(t, worker, scope);
t.add_cleanup(() => service_worker_unregister(t, scope));
await wait_for_state(t, reg.installing, 'activated');
// Load the scope as a frame. We expect this in turn to have a nested
@ -96,7 +99,6 @@ async function doAsyncTest(t, scope) {
}
frame.remove();
await service_worker_unregister_and_done(t, scope);
}
promise_test(async function(t) {
@ -126,6 +128,9 @@ promise_test(async function(t) {
const scope = 'resources/about-blank-replacement-uncontrolled-nested-frame.html';
let reg = await service_worker_unregister_and_register(t, worker, scope);
t.add_cleanup(() => service_worker_unregister(t, scope));
await wait_for_state(t, reg.installing, 'activated');
// Load the scope as a frame. We expect this in turn to have a nested
@ -147,7 +152,6 @@ promise_test(async function(t) {
'nested frame should not be controlled');
frame.remove();
await service_worker_unregister_and_done(t, scope);
}, 'Initial about:blank is controlled, exposed to clients.matchAll(), and ' +
'final Client is not controlled by a service worker.');

View file

@ -11,6 +11,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, script, scope)
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
var sw = registration.installing;
return new Promise(t.step_func(function(resolve) {
@ -23,9 +27,6 @@ promise_test(function(t) {
});
}));
})
.then(function() {
return service_worker_unregister_and_done(t, scope);
})
.catch(unreached_rejection(t));
}, 'installed event should be fired before activating service worker');

View file

@ -32,9 +32,13 @@ promise_test(function(t) {
// Register a service worker.
.then(() => service_worker_unregister_and_register(t, script, scope))
.then(r => worker = r.installing)
.then(() => wait_for_state(t, worker, 'activated'))
.then(r => {
t.add_cleanup(() => service_worker_unregister(t, scope));
worker = r.installing;
return wait_for_state(t, worker, 'activated');
})
// Let the service worker claim the iframe.
.then(() => {
var channel = new MessageChannel();
@ -62,7 +66,6 @@ promise_test(function(t) {
// Cleanup this testcase.
.then(() => frame.remove())
.then(() => service_worker_unregister_and_done(t, scope));
}, 'fetch() should be intercepted after the client is claimed.')
</script>

View file

@ -15,6 +15,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(
t, init_worker_url, init_scope)
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, init_scope);
});
return wait_for_state(t, registration.installing, 'activated');
})
.then(function() {
@ -35,6 +39,10 @@ promise_test(function(t) {
{scope: claim_scope});
})
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, claim_scope);
});
claim_worker = registration.installing;
claim_registration = registration;
return wait_for_state(t, registration.installing, 'activated');
@ -67,9 +75,6 @@ promise_test(function(t) {
frame1.remove();
frame2.remove();
return claim_registration.unregister();
})
.then(function() {
return service_worker_unregister_and_done(t, init_scope);
});
}, 'Test claim client which is not using registration');
@ -86,6 +91,10 @@ promise_test(function(t) {
claim_worker_url, {scope: claim_scope});
})
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, claim_scope);
});
claim_worker = registration.installing;
return wait_for_state(t, registration.installing, 'activated');
})
@ -94,6 +103,10 @@ promise_test(function(t) {
installing_worker_url, {scope: scope});
})
.then(function() {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
var channel = new MessageChannel();
var saw_message = new Promise(function(resolve) {
channel.port1.onmessage = t.step_func(function(e) {
@ -111,10 +124,6 @@ promise_test(function(t) {
'Frame should not be claimed when a longer-matched ' +
'registration exists');
frame.remove();
return service_worker_unregister(t, claim_scope);
})
.then(function() {
return service_worker_unregister_and_done(t, scope);
});
}, 'Test claim client when there\'s a longer-matched registration not ' +
'already used by the page');

View file

@ -30,9 +30,13 @@ promise_test(function(t) {
'fetch() should not be intercepted.'))
// Register a service worker.
.then(() => service_worker_unregister_and_register(t, script, scope))
.then(r => worker = r.installing)
.then(() => wait_for_state(t, worker, 'activated'))
.then(r => {
t.add_cleanup(() => service_worker_unregister(t, scope));
worker = r.installing;
return wait_for_state(t, worker, 'activated')
})
// Let the service worker claim the iframe and the shared worker.
.then(() => {
var channel = new MessageChannel();
@ -60,8 +64,7 @@ promise_test(function(t) {
'fetch() in the shared worker should be intercepted.'))
// Cleanup this testcase.
.then(() => frame.remove())
.then(() => service_worker_unregister_and_done(t, scope));
.then(() => frame.remove());
}, 'fetch() in SharedWorker should be intercepted after the client is claimed.')
</script>

View file

@ -13,6 +13,10 @@ promise_test(function(t) {
var worker, sw_registration, frame;
return service_worker_unregister_and_register(t, url1, scope)
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, registration.installing, 'activated');
})
.then(function() {
@ -50,9 +54,6 @@ promise_test(function(t) {
'Frame1 controller scriptURL should be changed to url2');
frame.remove();
return sw_registration.unregister();
})
.then(function() {
return service_worker_unregister_and_done(t, scope);
});
}, 'Test worker claims client which is using another registration');
@ -63,6 +64,10 @@ promise_test(function(t) {
var frame, worker;
return service_worker_unregister_and_register(t, url1, scope)
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, registration.installing, 'activated');
})
.then(function() {
@ -91,7 +96,6 @@ promise_test(function(t) {
})
.then(function() {
frame.remove();
return service_worker_unregister_and_done(t, scope);
});
}, 'Test for the waiting worker claims a client which is using the the ' +
'same registration');

View file

@ -54,6 +54,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(
t, 'resources/clients-matchall-worker.js', scope)
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, registration.installing, 'activated');
})
.then(function() { return with_iframe(iframe_url); })
@ -66,9 +70,7 @@ promise_test(function(t) {
})
.then(function() {
frame.remove();
return service_worker_unregister_and_done(t, scope);
})
.catch(unreached_rejection(t));
});
}, 'Verify matchAll() with window client type');
promise_test(function(t) {
@ -76,6 +78,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(
t, 'resources/clients-matchall-worker.js', scope)
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, registration.installing, 'activated');
})
.then(function() { return with_iframe(iframe_url); })
@ -112,7 +118,6 @@ promise_test(function(t) {
})
.then(function() {
frame.remove();
return service_worker_unregister_and_done(t, scope);
});
}, 'Verify matchAll() with {window, sharedworker, worker} client types');

View file

@ -123,6 +123,8 @@ function matchAllOrderTest(t, opts) {
let frameResultList;
let extraWindowResult;
return service_worker_unregister_and_register(t, script, opts.scope).then(swr => {
t.add_cleanup(() => service_worker_unregister(t, opts.scope));
worker = swr.installing;
return wait_for_state(t, worker, 'activated');
}).then(_ => {
@ -143,8 +145,6 @@ function matchAllOrderTest(t, opts) {
}).then(_ => {
frameResultList.forEach(result => result.top.remove());
extraWindowResult.top.remove();
}).then(_ => {
return service_worker_unregister_and_done(t, opts.scope);
}).catch(e => {
if (frameResultList) {
frameResultList.forEach(result => result.top.remove());

View file

@ -13,6 +13,10 @@ promise_test(function(t) {
var controller;
return service_worker_unregister(t, scope)
.then(function() {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return with_iframe(scope);
})
.then(function(f) {
@ -48,7 +52,6 @@ promise_test(function(t) {
.then(function(frameRegistration) {
assert_equals(frameRegistration.active, controller);
frame.remove();
service_worker_unregister_and_done(t, scope);
});
}, 'controller is set upon reload after registration');
</script>

View file

@ -32,6 +32,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, SCRIPT, SCOPE)
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, SCOPE);
});
return wait_for_state(t, registration.installing, 'activated');
})
.then(function() {
@ -105,7 +109,6 @@ promise_test(function(t) {
})
.then(function() {
frame.remove();
service_worker_unregister_and_done(t, SCOPE);
});
}, 'Verify CSP control of fetch() in a Service Worker');
</script>

View file

@ -15,6 +15,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, worker, scope)
.then(function(reg) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, reg.installing, 'activated');
})
.then(function() { return with_iframe(scope); })
@ -30,7 +34,6 @@ promise_test(function(t) {
.then(function(response) {
assert_equals(response, 'intercepted by service worker');
frame.remove();
return service_worker_unregister_and_done(t, scope);
})
}, 'Service Worker should respond to fetch event after the hash changes');
@ -43,6 +46,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, worker, scope)
.then(function(reg) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, reg.installing, 'activated');
})
.then(function() { return with_iframe(scope); })
@ -58,7 +65,6 @@ promise_test(function(t) {
.then(function(response) {
assert_equals(response, 'intercepted by service worker');
frame.remove();
return service_worker_unregister_and_done(t, scope);
})
}, 'Service Worker should respond to fetch event after the pushState');

View file

@ -9,6 +9,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, script, scope)
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, registration.installing, 'activated');
})
.then(function() {
@ -27,7 +31,6 @@ promise_test(function(t) {
})
.then(function(message) {
assert_equals(message, 'PASS');
return service_worker_unregister_and_done(t, scope);
})
}, 'Calling respondWith asynchronously throws an exception');
</script>

View file

@ -22,6 +22,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, script, scope)
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, registration.installing, 'activated');
})
.then(function() {
@ -34,7 +38,6 @@ promise_test(function(t) {
.then(function(result) {
frame.remove();
assert_equals(result, 'PASS');
return service_worker_unregister_and_done(t, scope);
});
}, 'Rejecting the fetch event or using preventDefault() causes a network ' +
'error');

View file

@ -22,6 +22,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, script, scope)
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, registration.installing, 'activated');
})
.then(function() {
@ -34,7 +38,6 @@ promise_test(function(t) {
.then(function(result) {
frame.remove();
assert_equals(result, 'PASS');
return service_worker_unregister_and_done(t, scope);
});
}, 'respondWith() takes either a Response or a promise that resolves ' +
'with a Response. Other values should raise a network error.');

View file

@ -10,6 +10,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, script, scope)
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, registration.installing, 'activated');
})
.then(function() {
@ -28,7 +32,6 @@ promise_test(function(t) {
})
.then(function(message) {
assert_equals(message, 'PASS');
return service_worker_unregister_and_done(t, scope);
})
}, 'respondWith() invokes stopImmediatePropagation()');
</script>

View file

@ -12,6 +12,10 @@ promise_test(function(t) {
var iframe;
return service_worker_unregister_and_register(t, workerscript, scope)
.then(function(reg) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, reg.installing, 'activated')
.then(() => reg.active);
})
@ -27,7 +31,6 @@ promise_test(function(t) {
})
.then(function(frame) {
assert_true(frame.contentDocument.body.innerHTML.includes("intercepted"));
service_worker_unregister_and_done(t, scope);
})
}, 'Fetch event handler throws after a successful respondWith()');

View file

@ -74,6 +74,8 @@ promise_test(function(t) {
var frame;
return service_worker_unregister_and_register(t, SCRIPT, SCOPE)
.then(function(registration) {
t.add_cleanup(() => service_worker_unregister(t, SCOPE));
worker = registration.installing;
return wait_for_state(t, worker, 'activated');
})
@ -181,7 +183,6 @@ promise_test(function(t) {
})
.then(function() {
frame.remove();
service_worker_unregister_and_done(t, SCOPE);
});
}, 'Verify redirect mode of Fetch API and ServiceWorker FetchEvent.');
@ -208,6 +209,8 @@ promise_test(function(t) {
var frame;
return service_worker_unregister_and_register(t, SCRIPT, SCOPE)
.then(function(registration) {
t.add_cleanup(() => service_worker_unregister(t, SCOPE));
worker = registration.installing;
return wait_for_state(t, worker, 'activated');
})
@ -275,7 +278,6 @@ promise_test(function(t) {
})
.then(function() {
frame.remove();
service_worker_unregister_and_done(t, SCOPE);
});
}, 'Verify redirected of Response(Fetch API) and ServiceWorker FetchEvent.');
@ -302,6 +304,8 @@ promise_test(function(t) {
var frame;
return service_worker_unregister_and_register(t, SCRIPT, SCOPE)
.then(function(registration) {
t.add_cleanup(() => service_worker_unregister(t, SCOPE));
worker = registration.installing;
return wait_for_state(t, worker, 'activated');
})
@ -375,7 +379,6 @@ promise_test(function(t) {
})
.then(function() {
frame.remove();
service_worker_unregister_and_done(t, SCOPE);
});
}, 'Verify redirected of Response(Fetch API), Cache API and ServiceWorker ' +
'FetchEvent.');

View file

@ -15,6 +15,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, expected_url, scope)
.then(function(r) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
registration = r;
return wait_for_state(t, registration.installing, 'activated');
})
@ -85,8 +89,6 @@ promise_test(function(t) {
'waiting should be null after activated.');
assert_equals(registration.active.scriptURL, expected_url,
'active should still exist after update found.');
return service_worker_unregister_and_done(t, scope);
});
}, 'Trigger multiple updates.');
</script>

View file

@ -17,7 +17,11 @@ promise_test(t => {
let slowURL = url + '&slow';
let frame;
return service_worker_unregister_and_register(t, script, scope)
.then(reg => wait_for_state(t, reg.installing, 'activated'))
.then(reg => {
t.add_cleanup(() => service_worker_unregister(t, scope));
return wait_for_state(t, reg.installing, 'activated');
})
.then(_ => with_iframe(scope))
.then(f => {
frame = f;
@ -39,7 +43,6 @@ promise_test(t => {
assert_greater_than(slowURLTime, urlTime + 1000,
'Slow service worker request should measure increased delay.');
frame.remove();
return service_worker_unregister_and_done(t, scope);
})
}, 'empty service worker fetch event included in performance timings');

View file

@ -52,8 +52,11 @@ promise_test(function(t) {
})
.then(
function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, registration.scope);
});
assert_unreached('register should fail');
service_worker_unregister_and_done(t, registration.scope);
},
function(error) {
assert_equals(error.name, 'SecurityError',

View file

@ -16,6 +16,10 @@ promise_test(function(t) {
return navigator.serviceWorker.register(bad_script, {scope: scope})
.then(function(r) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
registration = r;
assert_equals(registration.installing.scriptURL,
normalizeURL(bad_script));
@ -47,9 +51,6 @@ promise_test(function(t) {
normalizeURL(good_script));
return wait_for_state(t, registration.installing, 'activated');
})
.then(function() {
return service_worker_unregister_and_done(t, scope);
})
}, 'register worker that calls waitUntil with a promise that never ' +
'resolves in oninstall');

View file

@ -10,6 +10,10 @@ promise_test(function(t) {
var url = 'resources/postmessage-to-client-worker.js';
return service_worker_unregister_and_register(t, url, scope)
.then(function(r) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, r.installing, 'activated');
})
.then(function() {
@ -35,9 +39,6 @@ promise_test(function(t) {
});
worker.postMessage('PING');
});
})
.then(function() {
return service_worker_unregister_and_done(t, scope);
});
}, 'Test MessageEvent supplants ServiceWorkerMessageEvent.');

View file

@ -12,6 +12,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, service_worker, scope)
.then(function(r) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, r.installing, 'activated');
})
.then(function() {
@ -24,7 +28,6 @@ promise_test(function(t) {
})
.then(function(data) {
assert_equals(data, 'intercepted by service worker');
service_worker_unregister_and_done(t, scope);
});
}, 'Verify subresource loads in SharedWorker are controlled by a Service Worker');
@ -35,6 +38,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, service_worker, scope)
.then(function(r) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, r.installing, 'activated');
})
.then(function() {
@ -47,7 +54,6 @@ promise_test(function(t) {
})
.then(function(data) {
assert_equals(data, 'worker loading intercepted by service worker');
service_worker_unregister_and_done(t, scope);
});
}, 'Verify SharedWorker construction is controlled by a Service Worker');
@ -58,6 +64,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, service_worker, scope)
.then(function(r) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, r.installing, 'activated');
})
.then(function() {
@ -70,7 +80,6 @@ promise_test(function(t) {
})
.then(function(data) {
assert_equals(data, 'worker loading intercepted by service worker');
service_worker_unregister_and_done(t, scope);
});
}, 'Verify importScripts from SharedWorker is controlled by a Service Worker');
</script>

View file

@ -33,6 +33,10 @@ promise_test(function(t) {
});
return service_worker_unregister_and_register(t, url1, scope)
.then(function(r) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, r.installing, 'activated');
})
.then(function() {
@ -60,7 +64,6 @@ promise_test(function(t) {
})
.then(function() {
frame.remove();
return service_worker_unregister_and_done(t, scope);
});
}, 'Test skipWaiting when a installed worker is waiting');

View file

@ -14,6 +14,10 @@ promise_test(function(t) {
var sw_registration, activated_worker, waiting_worker;
return service_worker_unregister_and_register(t, url1, scope)
.then(function(registration) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
sw_registration = registration;
return wait_for_state(t, registration.installing, 'activated');
})
@ -48,7 +52,6 @@ promise_test(function(t) {
'Worker with url2 should be redundant');
assert_equals(sw_registration.active.scriptURL, normalizeURL(url3),
'Worker with url3 should be activated');
return service_worker_unregister_and_done(t, scope);
});
}, 'Test skipWaiting with both active and waiting workers');

View file

@ -17,6 +17,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, expected_url, scope)
.then(function(r) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
registration = r;
return wait_for_state(t, registration.installing, 'activated');
})
@ -41,7 +45,6 @@ promise_test(function(t) {
})
.then(function() {
frame.remove();
return service_worker_unregister_and_done(t, scope);
})
}, 'Update should be triggered after a functional event when last update time is over 24 hours');

View file

@ -43,8 +43,11 @@ settings.reduce((p, s) => {
return Promise.resolve()
// Register a service worker.
.then(_ => service_worker_unregister_and_register(t, script, scope))
.then(r => swr = r)
.then(_ => wait_for_update(t, swr))
.then(r => {
t.add_cleanup(() => service_worker_unregister(t, scope));
swr = r;
return wait_for_update(t, swr);
})
.then(w => sw = w)
.then(_ => wait_for_state(t, sw, 'activated'))
.then(_ => assert_array_equals([swr.active,
@ -64,10 +67,7 @@ settings.reduce((p, s) => {
swr.waiting,
swr.installing],
[sw, null, null]);
})
// Unregister the service worker.
.then(_ => service_worker_unregister_and_done(t, scope));
});
}, `Test(cors: ${s.cors}, main: ${s.main}, imported: ${s.imported})`));
}, Promise.resolve());

View file

@ -109,7 +109,7 @@ function navigate_test(override_parameters) {
});
}
var cleanup = function() {
test.add_cleanup(function() {
if (client_frame && client_frame) {
client_frame.remove();
}
@ -127,9 +127,9 @@ function navigate_test(override_parameters) {
if (registration) {
return registration.unregister();
}
};
});
var test_body = with_iframe(parameters.src_url)
return with_iframe(parameters.src_url)
.then(function(frame) {
client_frame = frame;
return service_worker_unregister_and_register(
@ -161,17 +161,6 @@ function navigate_test(override_parameters) {
.then(function(response) {
assert_equals(response.data, parameters.expected);
});
// Ensure that test "clean up" is deferred until after the test body
// executes. `Test#add_cleanup` cannot be used for this purpose because the
// operation is asynchronous, and `add_cleanup` does not support
// asynchronous operations at the time of this writing. See
// https://github.com/web-platform-tests/wpt/issues/6075
// Ensure also that test failure is not hidden by successful cleanup
// operation.
return test_body
.then(cleanup, cleanup)
.then(function() { return test_body; });
}, parameters.description);
}
</script>

View file

@ -12,6 +12,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, service_worker, scope)
.then(function(r) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, r.installing, 'activated');
})
.then(function() {
@ -28,7 +32,6 @@ promise_test(function(t) {
})
.then(function(data) {
assert_equals(data, 'worker loading intercepted by service worker');
service_worker_unregister_and_done(t, scope);
});
}, 'Verify worker script from uncontrolled document is intercepted by Service Worker');
@ -39,6 +42,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, service_worker, scope)
.then(function(r) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, r.installing, 'activated');
})
.then(function() {
@ -55,7 +62,6 @@ promise_test(function(t) {
})
.then(function(data) {
assert_equals(data, 'dummy-worker-script loaded');
service_worker_unregister_and_done(t, scope);
});
}, 'Verify worker script intercepted by same-origin response succeeds');
@ -72,10 +78,7 @@ promise_test(function(t) {
var w = new Worker(worker_url);
var watcher = new EventWatcher(t, w, ['message', 'error']);
return watcher.wait_for('error');
})
.then(function() {
service_worker_unregister_and_done(t, scope);
});
});
}, 'Verify worker script intercepted by cors response fails');
promise_test(function(t) {
@ -85,16 +88,17 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, service_worker, scope)
.then(function(r) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, r.installing, 'activated');
})
.then(function() {
var w = new Worker(worker_url);
var watcher = new EventWatcher(t, w, ['message', 'error']);
return watcher.wait_for('error');
})
.then(function() {
service_worker_unregister_and_done(t, scope);
});
});
}, 'Verify worker script intercepted by no-cors cross-origin response fails');
promise_test(function(t) {
@ -110,6 +114,10 @@ promise_test(function(t) {
return service_worker_unregister_and_register(t, service_worker, scope)
.then(function(r) {
t.add_cleanup(function() {
return service_worker_unregister(t, scope);
});
return wait_for_state(t, r.installing, 'activated');
})
.then(function() { return with_iframe(subdoc_url); })
@ -126,7 +134,6 @@ promise_test(function(t) {
})
.then(function(data) {
assert_equals(data.results, 'finish');
service_worker_unregister_and_done(t, scope);
});
}, 'Verify worker loads from controlled document are intercepted by Service Worker');

View file

@ -0,0 +1,30 @@
# This script is designed to be sourced from tools/docker/start.sh
# Start userspace OOM killer: https://github.com/rfjakob/earlyoom
# It will report memory usage every minute and prefer to kill browsers.
sudo earlyoom -p -r 60 --prefer '(chrome|firefox)' --avoid 'python' &
sudo sh -c './wpt make-hosts-file >> /etc/hosts'
if [[ $BROWSER == "chrome" ]] || [[ "$BROWSER" == all ]]
then
# Install Chrome dev
if [[ "$CHANNEL" == "dev" ]] || [[ "$CHANNEL" == "nightly" ]]
then
deb_archive=google-chrome-unstable_current_amd64.deb
elif [[ "$CHANNEL" == "beta" ]]
then
deb_archive=google-chrome-beta_current_amd64.deb
elif [[ "$CHANNEL" == "stable" ]]
then
deb_archive=google-chrome-stable_current_amd64.deb
else
echo Unrecognized release channel: $CHANNEL >&2
exit 1
fi
wget https://dl.google.com/linux/direct/$deb_archive
sudo apt-get -qqy update && sudo gdebi -n $deb_archive
fi
sudo Xvfb $DISPLAY -screen 0 ${SCREEN_WIDTH}x${SCREEN_HEIGHT}x${SCREEN_DEPTH} &

View file

@ -17,19 +17,16 @@ REVISION=${3:-FETCH_HEAD}
BROWSER=${4:-all}
CHANNEL=${5:-nightly}
# Start userspace OOM killer: https://github.com/rfjakob/earlyoom
# It will report memory usage every minute and prefer to kill browsers.
sudo earlyoom -p -r 60 --prefer '(chrome|firefox)' --avoid 'python' &
cd ~
mkdir web-platform-tests
cd web-platform-tests
git init
git remote add origin ${REMOTE}
# Initially we just fetch 50 commits in order to save several minutes of fetching
git fetch --quiet --depth=50 origin ${REF}
git fetch --quiet --depth=50 --tags origin ${REF}
if [[ ! `git rev-parse --verify -q ${REVISION}` ]];
then
@ -40,27 +37,4 @@ then
fi
git checkout -b build ${REVISION}
sudo sh -c './wpt make-hosts-file >> /etc/hosts'
if [[ $BROWSER == "chrome" ]] || [[ "$BROWSER" == all ]]
then
# Install Chrome dev
if [[ "$CHANNEL" == "dev" ]] || [[ "$CHANNEL" == "nightly" ]]
then
deb_archive=google-chrome-unstable_current_amd64.deb
elif [[ "$CHANNEL" == "beta" ]]
then
deb_archive=google-chrome-beta_current_amd64.deb
elif [[ "$CHANNEL" == "stable" ]]
then
deb_archive=google-chrome-stable_current_amd64.deb
else
echo Unrecognized release channel: $CHANNEL >&2
exit 1
fi
wget https://dl.google.com/linux/direct/$deb_archive
sudo apt-get -qqy update && sudo gdebi -n $deb_archive
fi
sudo Xvfb $DISPLAY -screen 0 ${SCREEN_WIDTH}x${SCREEN_HEIGHT}x${SCREEN_DEPTH} &
source tools/ci/start.sh

View file

@ -577,7 +577,10 @@ class MultiDict(dict):
:param key: The key to lookup
"""
return dict.__getitem__(self, key)
if key in self:
return dict.__getitem__(self, key)
else:
return []
@classmethod
def from_field_storage(cls, fs):

View file

@ -1495,12 +1495,34 @@ function testAnimationSamplesWithAnyOrder(animation, idlName, testSamples) {
}
}
function RoundMatrix(style) {
var matrixMatch = style.match(/^(matrix(3d)?)\(.+\)$/);
if (!!matrixMatch) {
var matrixType = matrixMatch[1];
var matrixArgs = style.substr(matrixType.length);
var extractmatrix = function(matrixStr) {
var list = [];
var regex = /[+\-]?[0-9]+[.]?[0-9]*(e[+/-][0-9]+)?/g;
var match = undefined;
do {
match = regex.exec(matrixStr);
if (match) {
list.push(parseFloat(parseFloat(match[0]).toFixed(6)));
}
} while (match);
return list;
}
return matrixType + '(' + extractmatrix(matrixArgs).join(', ') + ')';
}
return style;
}
function testAnimationSampleMatrices(animation, idlName, testSamples) {
const target = animation.effect.target;
for (const testSample of testSamples) {
animation.currentTime = testSample.time;
const actual = getComputedStyle(target)[idlName];
const expected = createMatrixFromArray(testSample.expected);
const actual = RoundMatrix(getComputedStyle(target)[idlName]);
const expected = RoundMatrix(createMatrixFromArray(testSample.expected));
assert_matrix_equals(actual, expected,
`The value should be ${expected} at`
+ ` ${testSample.time}ms but got ${actual}`);

View file

@ -1,57 +0,0 @@
<!DOCTYPE html>
<body>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src="resources/webxr_util.js"></script>
<canvas></canvas>
<script>
let immersiveTestName = "XRFrame methods throw exceptions outside of the " +
"requestAnimationFrame callback for immersive sessions";
let nonImmersiveTestName = "XRFrame methods throw exceptions outside of the " +
"requestAnimationFrame callback for non-immersive sessions";
let fakeDeviceInitParams = { supportsImmersive:true };
let immersiveSessionOptions = { immersive: true };
let nonImmersiveSessionOptions = { outputContext: getOutputContext() };
let testFunction = (testSession, testController, t) => new Promise((resolve) => {
let staleFrame = null;
let frameOfRef = null;
function onFrame(time, xrFrame) {
t.step(() => {
assert_true(xrFrame instanceof XRFrame);
});
staleFrame = xrFrame;
step_timeout(afterFrame, 0);
}
function afterFrame() {
t.step(() => {
// Attempting to call a method on the frame outside the callback that
// originally provided it should cause it to throw an exception.
assert_throws('NotAllowedError', () => staleFrame.getDevicePose(frameOfRef));
});
// Test does not complete until the this function has executed.
resolve();
}
testSession.requestFrameOfReference('eye-level').then((xrFrameOfRef) => {
frameOfRef = xrFrameOfRef;
testSession.requestAnimationFrame(onFrame);
});
});
xr_session_promise_test(immersiveTestName, testFunction,
fakeDeviceInitParams, immersiveSessionOptions);
xr_session_promise_test(nonImmersiveTestName, testFunction,
fakeDeviceInitParams, nonImmersiveSessionOptions);
</script>
</body>