Index: third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html |
diff --git a/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html b/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html |
index 00fbba52ce1d0a5a1ab2f2ab1682575d545bfe4c..453a5ad136b5ebe85650d966565dbb902e984bf5 100644 |
--- a/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html |
+++ b/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html |
@@ -23,6 +23,19 @@ test(() => assert_throws( |
'Test that negative frequency causes exception from constructor.'); |
sensor_test(sensor => { |
+ sensor.mockSensorProvider.setGetSensorShouldFail(true); |
+ let ambientLightSensor = new AmbientLightSensor(); |
+ ambientLightSensor.start(); |
+ return new Promise((resolve, reject) => { |
+ ambientLightSensor.onstatechange = event => { |
+ if(ambientLightSensor.state == 'errored') { |
+ resolve(); |
+ } |
+ }; |
+ }); |
+}, 'Test that sensor state changes to "errored" when sensor is not supported.'); |
+ |
+sensor_test(sensor => { |
let ambientLightSensor = new AmbientLightSensor({frequency: 560}); |
ambientLightSensor.start(); |