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

Side by Side Diff: third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html

Issue 2395853003: [Sensors] Improvements in shared buffer managing (Closed)
Patch Set: Test compilation fix + comment from Ken Created 4 years, 2 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="../resources/mojo-helpers.js"></script> 4 <script src="../resources/mojo-helpers.js"></script>
5 <script src="resources/sensor-helpers.js"></script> 5 <script src="resources/sensor-helpers.js"></script>
6 <script> 6 <script>
7 7
8 'use strict'; 8 'use strict';
9 9
10 if (!window.testRunner) 10 if (!window.testRunner)
11 debug('This test cannot be run without the TestRunner'); 11 debug('This test cannot be run without the TestRunner');
12 12
13 const kDefaultReadingValue = 3.1415; 13 const kDefaultReadingValue = 3.1415;
14 14
15 function update_sensor_reading(buffer) { 15 function update_sensor_reading(buffer) {
16 buffer[0] = window.performance.now(); 16 buffer[1] = window.performance.now();
17 buffer[1] = kDefaultReadingValue; 17 buffer[2] = kDefaultReadingValue;
18 } 18 }
19 19
20 test(() => assert_throws( 20 test(() => assert_throws(
21 new RangeError(), 21 new RangeError(),
22 () => new AmbientLightSensor({frequency: -60})), 22 () => new AmbientLightSensor({frequency: -60})),
23 'Test that negative frequency causes exception from constructor.'); 23 'Test that negative frequency causes exception from constructor.');
24 24
25 sensor_test(sensor => { 25 sensor_test(sensor => {
26 sensor.mockSensorProvider.setGetSensorShouldFail(true); 26 sensor.mockSensorProvider.setGetSensorShouldFail(true);
27 let ambientLightSensor = new AmbientLightSensor(); 27 let ambientLightSensor = new AmbientLightSensor();
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 ambientLightSensor.onerror = reject; 260 ambientLightSensor.onerror = reject;
261 }); 261 });
262 }) 262 })
263 .then(mockSensor => { return mockSensor.removeConfigurationCalled(); }); 263 .then(mockSensor => { return mockSensor.removeConfigurationCalled(); });
264 264
265 return testPromise; 265 return testPromise;
266 }, 'Test that sensor receives suspend / resume notifications when page' 266 }, 'Test that sensor receives suspend / resume notifications when page'
267 +' visibility changes.'); 267 +' visibility changes.');
268 268
269 </script> 269 </script>
OLDNEW
« no previous file with comments | « device/generic_sensor/sensor_provider_impl.cc ('k') | third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698