Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(503)

Unified Diff: content/test/data/generic_sensor/ambient_light_sensor_test.html

Issue 2472403002: [Sensors] Align sensor reading attribute implementation with the specification (Closed)
Patch Set: Comments from Tim Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/generic_sensor/ambient_light_sensor_test.html
diff --git a/content/test/data/generic_sensor/ambient_light_sensor_test.html b/content/test/data/generic_sensor/ambient_light_sensor_test.html
index 346bfc14b22ca04dd1421a2c0c5c74ca3793869d..939d29a3181950a9f5b9015347e9310c812acd9c 100644
--- a/content/test/data/generic_sensor/ambient_light_sensor_test.html
+++ b/content/test/data/generic_sensor/ambient_light_sensor_test.html
@@ -3,10 +3,11 @@
<title>AmbientLight Generic Sensor test</title>
<script type="text/javascript">
var timeOrigin;
- function onAmbientLightReadingChange(event) {
- if (event.reading.illuminance == 50 &&
- event.reading.timeStamp > timeOrigin &&
- event.reading.timeStamp < window.performance.now()) {
+ var sensor;
+ function onAmbientLightReadingChange() {
+ if (sensor.reading.illuminance == 50 &&
+ sensor.reading.timeStamp > timeOrigin &&
+ sensor.reading.timeStamp < window.performance.now()) {
pass();
} else {
fail();
@@ -14,11 +15,10 @@
}
function start() {
- var sensor = new AmbientLightSensor();
+ sensor = new AmbientLightSensor();
timeOrigin = window.performance.now();
- sensor.onchange = function(e) {
- onAmbientLightReadingChange(e);
- };
+ sensor.onchange =
+ onAmbientLightReadingChange;
sensor.start();
}
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698