New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 799043 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug-Regression



Sign in to add a comment

DeviceOrientation sends fake events as first event

Project Member Reported by mlamouri@chromium.org, Jan 4 2018

Issue description

Test page: http://mounirlamouri.github.io/sandbox/deviceorientation/one-shot.html

STR:
1. Open test page

Expected result: on mobile devices, output looks like random angles
Actual result: 0, 0, 0 is shown

Given that websites use the events first result to guess support, this could lead to interop issues. For example, internal code (media controls) ended up broken, assuming that the device did not support device orientation.

Firefox properly returns angles for the first result.
 
Labels: -Pri-3 Pri-1
I believe the issue here is that we are not checking if |timestamp| in the SensorReading is non-zero in SensorReadingCouldBeRead as is done by Sensor::hasReading in the Generic Sensors API.

Given the limited time before the Chrome 64 stable release I think we should revert https://chromium-review.googlesource.com/c/chromium/src/+/726261 on the M64 branch to return DeviceOrientation back to the old implementation for this release.

Between https://chromium-review.googlesource.com/c/chromium/src/+/798595 and the fix for this bug we can try again in Chrome 65.
Cc: amineer@chromium.org
I would be in favour of this as fixing the rotate to fullscreen feature would already require to merge 3 hotfixs to beta. +amineer@ WDYT?
Status: Started (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, Jan 5 2018

Labels: merge-merged-3282
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fbeb6df58442b011d5ebccad251286dcb15dc9f7

commit fbeb6df58442b011d5ebccad251286dcb15dc9f7
Author: Reilly Grant <reillyg@chromium.org>
Date: Fri Jan 05 19:55:15 2018

[M-64] Revert DeviceOrientationEventPump refactoring

This patch reverts the following two changes in order to resolve
regressions introduced in M-64 which will be fixed on HEAD with other
changes:

"Reland: Refactor DeviceOrientationEventPump to use generic sensor as its backend"
https://chromium-review.googlesource.com/726261

"Return Sensor pipe in SensorInitParams"
https://chromium-review.googlesource.com/757283

This patch was tested by running all *Sensor* tests in unit_tests,
browser_tests, content_unittests, content_browsertests and
services_unittests, by verifying that "rotate to full screen"
works on youtube.com and by running the one-shot.html test from
 issue 799043 .

Bug:  721427 , 794713 , 798409 , 799043 
Change-Id: I2c0573578d6a333b62aa9fd53a57d08d94454783
Reviewed-on: https://chromium-review.googlesource.com/850822
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/branch-heads/3282@{#423}
Cr-Branched-From: 5fdc0fab22ce7efd32532ee989b223fa12f8171e-refs/heads/master@{#520840}
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/content/browser/device_sensors/device_sensor_browsertest.cc
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/content/browser/generic_sensor/sensor_provider_proxy_impl.cc
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/content/browser/generic_sensor/sensor_provider_proxy_impl.h
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/content/browser/generic_sensor_browsertest.cc
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/content/renderer/device_sensors/device_motion_event_pump.cc
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/content/renderer/device_sensors/device_motion_event_pump.h
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/content/renderer/device_sensors/device_motion_event_pump_unittest.cc
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/content/renderer/device_sensors/device_orientation_event_pump.cc
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/content/renderer/device_sensors/device_orientation_event_pump.h
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/content/renderer/device_sensors/device_orientation_event_pump_unittest.cc
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/content/renderer/device_sensors/device_sensor_event_pump.h
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/content/renderer/renderer_blink_platform_impl.cc
[delete] https://crrev.com/45377e18a2ec8f726df564835e9e8e8ccaeea6ec/content/test/data/device_sensors/device_orientation_fallback_to_absolute_test.html
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/services/device/device_service.cc
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/services/device/device_service.h
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/services/device/generic_sensor/generic_sensor_service_unittest.cc
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/services/device/generic_sensor/sensor_provider_impl.cc
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/services/device/generic_sensor/sensor_provider_impl.h
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/services/device/public/interfaces/sensor_provider.mojom
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
[modify] https://crrev.com/fbeb6df58442b011d5ebccad251286dcb15dc9f7/third_party/WebKit/Source/modules/sensor/SensorProxy.h

I am not seeing any merge request / merge approval here. Am I missing something?
Status: Fixed (was: Started)
Merge approval was given on  issue 794713 .
Project Member

Comment 8 by bugdroid1@chromium.org, Jan 11 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/db76d1f9c486bc48c90ca07779b767b7870b92ed

commit db76d1f9c486bc48c90ca07779b767b7870b92ed
Author: Jun Cai <juncai@chromium.org>
Date: Thu Jan 11 22:11:59 2018

No device orientation/motion event sent when sensor reading timestamp is zero

This CL fixes the issue when sensor is initialized but its sensor
data is still not available (the timestamp is zero), in this case, device
orientation/motion event should not be sent until there is sensor data.

Bug:  799043 
Change-Id: I6b1b82a9f465b47bafc9e33e8be007d81a614f75
Reviewed-on: https://chromium-review.googlesource.com/851089
Commit-Queue: Jun Cai <juncai@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528772}
[modify] https://crrev.com/db76d1f9c486bc48c90ca07779b767b7870b92ed/content/renderer/device_sensors/device_motion_event_pump.cc
[modify] https://crrev.com/db76d1f9c486bc48c90ca07779b767b7870b92ed/content/renderer/device_sensors/device_motion_event_pump.h
[modify] https://crrev.com/db76d1f9c486bc48c90ca07779b767b7870b92ed/content/renderer/device_sensors/device_motion_event_pump_unittest.cc
[modify] https://crrev.com/db76d1f9c486bc48c90ca07779b767b7870b92ed/content/renderer/device_sensors/device_orientation_event_pump.cc
[modify] https://crrev.com/db76d1f9c486bc48c90ca07779b767b7870b92ed/content/renderer/device_sensors/device_orientation_event_pump_unittest.cc

Cc: adithyas@chromium.org timvolod...@chromium.org juncai@chromium.org
 Issue 783891  has been merged into this issue.

Sign in to add a comment