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

Side by Side Diff: content/test/data/generic_sensor/ambient_light_sensor_test.html

Issue 2668173003: [Sensors] Remove SensorReading interfaces (Closed)
Patch Set: updated global-interface-listing.html Created 3 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | device/generic_sensor/public/cpp/sensor_reading.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <title>AmbientLight Generic Sensor test</title> 3 <title>AmbientLight Generic Sensor test</title>
4 <script type="text/javascript"> 4 <script type="text/javascript">
5 var timeOrigin; 5 var timeOrigin;
6 var sensor; 6 var sensor;
7 function onAmbientLightReadingChange() { 7 function onAmbientLightReadingChange() {
8 if (sensor.reading.illuminance == 50 && 8 if (sensor.illuminance == 50 &&
9 sensor.reading.timeStamp > timeOrigin && 9 sensor.timestamp > timeOrigin &&
10 sensor.reading.timeStamp < window.performance.now()) { 10 sensor.timestamp < window.performance.now()) {
11 pass(); 11 pass();
12 } else { 12 } else {
13 fail(); 13 fail();
14 } 14 }
15 } 15 }
16 16
17 function start() { 17 function start() {
18 sensor = new AmbientLightSensor(); 18 sensor = new AmbientLightSensor();
19 timeOrigin = window.performance.now(); 19 timeOrigin = window.performance.now();
20 sensor.onchange = 20 sensor.onchange =
21 onAmbientLightReadingChange; 21 onAmbientLightReadingChange;
22 sensor.start(); 22 sensor.start();
23 } 23 }
24 24
25 function pass() { 25 function pass() {
26 document.getElementById('status').innerHTML = 'PASS'; 26 document.getElementById('status').innerHTML = 'PASS';
27 document.location = '#pass'; 27 document.location = '#pass';
28 } 28 }
29 29
30 function fail() { 30 function fail() {
31 document.location = '#fail'; 31 document.location = '#fail';
32 } 32 }
33 </script> 33 </script>
34 </head> 34 </head>
35 <body onLoad="start()"> 35 <body onLoad="start()">
36 <div id="status">FAIL</div> 36 <div id="status">FAIL</div>
37 </body> 37 </body>
38 </html> 38 </html>
OLDNEW
« no previous file with comments | « no previous file | device/generic_sensor/public/cpp/sensor_reading.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698