зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1638406 [wpt PR 23640] - sensors: Remove cross-origin iframe test from runGenericSensorTests()., a=testonly
Automatic update from web-platform-tests sensors: Remove cross-origin iframe test from runGenericSensorTests(). This test is wrong, which causes it to be flaky: it just adds an iframe and waits for it to load without properly taking care of window focus, so the sensor in the main window continued running and we could end up receiving an unexpected "reading" event if the iframe's "load" event took to long to be delivered. Remove the test altogether in favor of run_generic_sensor_iframe_tests(), which checks for the same thing the right way (although it is also a bit flaky...). Bug: 731018 Change-Id: I568f032233be767a2d2a3d50bd3de8d8ce3db0ef Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2204024 Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> Commit-Queue: Reilly Grant <reillyg@chromium.org> Reviewed-by: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/master@{#769458} -- wpt-commits: 257af6a7bd889bf588a438d70f6f01fed9fca66f wpt-pr: 23640
This commit is contained in:
Родитель
c29ab2c51d
Коммит
26e3b60974
|
@ -428,41 +428,6 @@ function runGenericSensorTests(sensorName,
|
|||
assert_greater_than(fastCounter, 2, "Fast sensor overtakes the slow one");
|
||||
}, `${sensorName}: frequency hint works.`);
|
||||
|
||||
sensor_test(async (t, sensorProvider) => {
|
||||
assert_true(sensorName in self);
|
||||
// Create a focused editbox inside a cross-origin iframe,
|
||||
// sensor notification must suspend.
|
||||
const iframeSrc = 'data:text/html;charset=utf-8,<html><body>'
|
||||
+ '<input type="text" autofocus></body></html>';
|
||||
const iframe = document.createElement('iframe');
|
||||
iframe.src = encodeURI(iframeSrc);
|
||||
|
||||
const sensor = new sensorType();
|
||||
const sensorWatcher = new EventWatcher(t, sensor, ["reading", "error"]);
|
||||
sensor.start();
|
||||
|
||||
const mockSensor = await sensorProvider.getCreatedSensor(sensorName);
|
||||
await mockSensor.setSensorReading(readings);
|
||||
|
||||
await sensorWatcher.wait_for("reading");
|
||||
const expected = new RingBuffer(expectedReadings).next().value;
|
||||
assert_true(verificationFunction(expected, sensor));
|
||||
const cachedTimestamp1 = sensor.timestamp;
|
||||
|
||||
const iframeWatcher = new EventWatcher(t, iframe, "load");
|
||||
document.body.appendChild(iframe);
|
||||
await iframeWatcher.wait_for("load");
|
||||
const cachedTimestamp2 = sensor.timestamp;
|
||||
assert_equals(cachedTimestamp1, cachedTimestamp2);
|
||||
|
||||
iframe.remove();
|
||||
await sensorWatcher.wait_for("reading");
|
||||
assert_greater_than(sensor.timestamp, cachedTimestamp1);
|
||||
|
||||
sensor.stop();
|
||||
}, `${sensorName}: sensor receives suspend / resume notifications when\
|
||||
cross-origin subframe is focused.`);
|
||||
|
||||
// Re-enable after https://github.com/w3c/sensors/issues/361 is fixed.
|
||||
// test(() => {
|
||||
// assert_throws_dom("NotSupportedError",
|
||||
|
|
Загрузка…
Ссылка в новой задаче