mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision b'b728032f59a396243864b0f8584e7211e3632005'
This commit is contained in:
parent
ace9b32b1c
commit
df68c4e5d1
15632 changed files with 514865 additions and 155000 deletions
|
@ -155,4 +155,32 @@ function run_generic_sensor_iframe_tests(sensorName) {
|
|||
iframe.parentNode.removeChild(iframe);
|
||||
window.focus();
|
||||
}, `${sensorName}: losing a document's frame with an active sensor does not crash`);
|
||||
|
||||
sensor_test(async t => {
|
||||
assert_implements(sensorName in self, `${sensorName} is not supported.`);
|
||||
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');
|
||||
|
||||
// The purpose of this message is to initialize the mock backend in the
|
||||
// iframe. We are not going to use the sensor created there.
|
||||
await send_message_to_iframe(iframe, {command: 'create_sensor',
|
||||
type: sensorName});
|
||||
|
||||
const iframeSensor = new iframe.contentWindow[sensorName]();
|
||||
assert_not_equals(iframeSensor, null);
|
||||
|
||||
// Remove iframe from main document. |iframeSensor| no longer has a
|
||||
// non-null browsing context. Calling start() should probably throw an
|
||||
// error when called from a non-fully active document, but that depends on
|
||||
// https://github.com/w3c/sensors/issues/415
|
||||
iframe.parentNode.removeChild(iframe);
|
||||
iframeSensor.start();
|
||||
}, `${sensorName}: calling start() in a non-fully active document does not crash`);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue