Bug 1638406 [wpt PR 23640] - sensors: Remove cross-origin iframe test from runGenericSensorTests()., a=testonly
authorRaphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Thu, 21 May 2020 10:23:32 +0000
changeset 532037 2d2ce2f359182ce712895c5417dcf5cdff9e5654
parent 532036 9f61afeb823920a304695e94314f29205809df6e
child 532038 5def2c28fc034faf30428e50975da53ab25f7693
push id37449
push userncsoregi@mozilla.com
push dateTue, 26 May 2020 02:38:57 +0000
treeherdermozilla-central@da2c7b0ac9a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1638406, 23640, 731018, 2204024, 769458
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
testing/web-platform/tests/generic-sensor/generic-sensor-tests.js
--- a/testing/web-platform/tests/generic-sensor/generic-sensor-tests.js
+++ b/testing/web-platform/tests/generic-sensor/generic-sensor-tests.js
@@ -423,51 +423,16 @@ function runGenericSensorTests(sensorNam
         }
         fastSensorNotifiedCounter++;
       }
       fastSensor.onerror = reject;
     });
     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",
 //         () => { new sensorType({invalid: 1}) });
 //     assert_throws_dom("NotSupportedError",
 //         () => { new sensorType({frequency: 60, invalid: 1}) });
 //     if (!expectedRemappedReadings) {
 //       assert_throws_dom("NotSupportedError",