diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/ambient-light/AmbientLightSensor.https.html | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/ambient-light/AmbientLightSensor.https.html')
-rw-r--r-- | testing/web-platform/tests/ambient-light/AmbientLightSensor.https.html | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/testing/web-platform/tests/ambient-light/AmbientLightSensor.https.html b/testing/web-platform/tests/ambient-light/AmbientLightSensor.https.html new file mode 100644 index 0000000000..a8c65e4d3f --- /dev/null +++ b/testing/web-platform/tests/ambient-light/AmbientLightSensor.https.html @@ -0,0 +1,63 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>AmbientLightSensor Test</title> +<meta name="timeout" content="long"> +<link rel="author" title="Intel" href="http://www.intel.com"> +<link rel="help" href="https://www.w3.org/TR/ambient-light/"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/generic-sensor/resources/generic-sensor-helpers.js"></script> +<script src="/generic-sensor/generic-sensor-tests.js"></script> +<script> + +'use strict'; + +const kReadings = { + readings: [ + // Readings are selected so that illuminance significance check causes + // the following to happen: + // 1. First two values test situation when two values would be rounded + // to same value. As the second value would be rounded to same value + // as first it won't trigger reading event. + // 2. New value is set to 24. And test checks it is correctly rounded to + // 0. + // 3. New reading is attempted to set to 35. + // 4. Value is read from sensor and compared new reading. But as new + // reading was not significantly different compared to initial, for + // privacy reasons, service returns the initial value. + // 5. New value is set to 49. And test checks it is correctly rounded to + // 50. New value is allowed as it is significantly different compared + // to old value (24). + // 6. New reading is attempted to set to 35. + // 7. Value is read from sensor and compared new reading. But as new + // reading was not significantly different compared to initial, for + // privacy reasons, service returns the initial value. + // 8. New value is set to 23. And test checks it is correctly rounded to + // 0. New value is allowed as it is significantly different compared + // to old value (49). + // + // Note: Readings and expectedReadings wraps around correctly as next + // value would be 150 (output from 127). + [127], + [165], + [24], + [35], + [49], + [35], + [23] + ], + expectedReadings: [ + [150], // output from 127 + [0], // output from 24 + [50], // output from 49 + [0] // output from 23 + ] +}; + +runGenericSensorTests( + 'AmbientLightSensor', + kReadings, + verifyAlsSensorReading, + ['ambient-light-sensor']); + +</script> |