| <!DOCTYPE html> | |
| <script src="../resources/testharness.js"></script> | |
| <script src="../resources/testharnessreport.js"></script> | |
| <script src="../http/tests/resources/sensor-helpers.js"></script> | |
| <script src="file:///gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script> | |
| <script src="file:///gen/services/device/public/mojom/sensor_provider.mojom.js"></script> | |
| <script src="resources/generic-sensor-tests.js"></script> | |
| <script> | |
| 'use strict'; | |
| if (!window.testRunner) | |
| debug('This test cannot be run without the TestRunner'); | |
| const kDefaultReading = [-19.2, 12.1, -44.3]; | |
| const kMappedReading = [-12.1, -19.2, -44.3]; | |
| function update_sensor_reading(buffer) { | |
| buffer.set(kDefaultReading, 2); | |
| } | |
| runGenericSensorTests( | |
| Magnetometer, | |
| device.mojom.SensorType.MAGNETOMETER, | |
| update_sensor_reading, | |
| verify_xyz_sensor_reading.bind(null, kDefaultReading), | |
| verify_xyz_sensor_reading.bind(null, kMappedReading), | |
| ['magnetometer']); | |
| </script> |