mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
Update web-platform-tests to revision e29e596073468910d8655a8ec23262f17543e147
This commit is contained in:
parent
e56db1f322
commit
5e2118728a
67 changed files with 1403 additions and 821 deletions
|
@ -5,7 +5,6 @@ async function send_message_to_iframe(iframe, message, reply) {
|
|||
|
||||
return new Promise((resolve, reject) => {
|
||||
let messageHandler = e => {
|
||||
|
||||
if (e.data.command !== message.command) {
|
||||
return;
|
||||
}
|
||||
|
@ -131,4 +130,31 @@ function run_generic_sensor_iframe_tests(sensorName) {
|
|||
iframe.parentNode.removeChild(iframe);
|
||||
}, `${sensorName}: sensor is not suspended when focus traverses from\
|
||||
to same-origin frame`);
|
||||
|
||||
sensor_test(async t => {
|
||||
assert_true(sensorName in self);
|
||||
const iframe = document.createElement('iframe');
|
||||
iframe.allow = featurePolicies.join(';') + ';';
|
||||
iframe.src = 'https://{{host}}:{{ports[https][0]}}/generic-sensor/resources/iframe_sensor_handler.html';
|
||||
|
||||
// Create sensor in the iframe (we do not care whether this is a
|
||||
// cross-origin nested context in this test).
|
||||
const iframeLoadWatcher = new EventWatcher(t, iframe, 'load');
|
||||
document.body.appendChild(iframe);
|
||||
await iframeLoadWatcher.wait_for('load');
|
||||
await send_message_to_iframe(iframe, {command: 'create_sensor',
|
||||
type: sensorName});
|
||||
iframe.contentWindow.focus();
|
||||
await send_message_to_iframe(iframe, {command: 'start_sensor'});
|
||||
|
||||
// Remove iframe from main document and change focus. When focus changes,
|
||||
// we need to determine whether a sensor must have its execution suspended
|
||||
// or resumed (section 4.2.3, "Focused Area" of the Generic Sensor API
|
||||
// spec). In Blink, this involves querying a frame, which might no longer
|
||||
// exist at the time of the check.
|
||||
// Note that we cannot send the "reset_sensor_backend" command because the
|
||||
// iframe is discarded with the removeChild call.
|
||||
iframe.parentNode.removeChild(iframe);
|
||||
window.focus();
|
||||
}, `${sensorName}: losing a document's frame with an active sensor does not crash`);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue